Changeset 1278

Show
Ignore:
Timestamp:
11/15/08 21:56:36 (22 months ago)
Author:
ahu
Message:

skip remote masters that result in too much timeouts during domain checking cycle. Tested in real life by Tyler Hall on 50000 domains.

Location:
trunk/pdns/pdns
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/communicator.cc

    r1277 r1278  
    247247      (sdomains.size()>1 ? "" : "s")<< 
    248248      " checking"<<endl; 
    249  
     249  map<string, int> skipMasters; 
    250250  for(vector<DomainInfo>::iterator i=sdomains.begin();i!=sdomains.end();++i) { 
    251251    Resolver resolver;    
     
    262262    for(vector<string>::const_iterator iter = i->masters.begin(); iter != i->masters.end(); ++iter) { 
    263263      try { 
     264        if(skipMasters[*iter] > 5) 
     265          throw AhuException("Skipping query to '"+*iter+"' because of previous timeouts in this cycle"); 
     266         
    264267        resolver.getSoaSerial(*iter, i->zone, &theirserial); 
    265          
     268        skipMasters[*iter]=0;    
    266269        if(theirserial<i->serial) { 
    267270          L<<Logger::Error<<"Domain "<<i->zone<<" more recent than master, our serial "<<ourserial<<" > their serial "<<theirserial<<endl; 
     
    279282      } 
    280283      catch(ResolverException &re) { 
     284        if(re.reason.find("Timeout") != string::npos) 
     285          skipMasters[*iter]++; 
     286 
    281287        L<<Logger::Error<<"Error trying to retrieve/refresh '"+i->zone+"': "+re.reason<<endl; 
    282288        if(next(iter) != i->masters.end())  
  • trunk/pdns/pdns/resolver.cc

    r1215 r1278  
    185185 
    186186  struct timeval timeout; 
    187   timeout.tv_sec=1; 
    188   timeout.tv_usec=500000; 
     187  timeout.tv_sec=0; 
     188  timeout.tv_usec=750000; 
    189189 
    190190  int res=select(d_sock+1,&rd,0,0,&timeout);