Changeset 2345

Show
Ignore:
Timestamp:
01/16/12 08:24:11 (17 months ago)
Author:
peter
Message:

backport r2109 to fix slave crashes

Location:
tags/pdns-2-9-22-x/pdns
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • tags/pdns-2-9-22-x/pdns/dnsbackend.hh

    r2063 r2345  
    4343struct DomainInfo 
    4444{ 
     45  DomainInfo() : backend(0) {} 
    4546  uint32_t id; 
    4647  string zone; 
  • tags/pdns-2-9-22-x/pdns/slavecommunicator.cc

    r2063 r2345  
    6161  L<<Logger::Error<<"Initiating transfer of '"<<domain<<"' from remote '"<<remote<<"'"<<endl; 
    6262  uint32_t domain_id; 
    63   PacketHandler P; 
     63  PacketHandler P; // fresh UeberBackend 
    6464 
    6565  DomainInfo di; 
     
    7272    UeberBackend *B=dynamic_cast<UeberBackend *>(P.getBackend()); 
    7373 
    74     if(!B->getDomainInfo(domain, di) || !di.backend) { 
     74    if(!B->getDomainInfo(domain, di) || !di.backend) { // di.backend and B are mostly identical 
    7575      L<<Logger::Error<<"Can't determine backend for domain '"<<domain<<"'"<<endl; 
    7676      return; 
     
    165165{ 
    166166  Lock l(&d_lock); 
    167   d_tocheck.insert(di); 
     167  DomainInfo ours = di; 
     168  ours.backend = 0; 
     169  d_tocheck.insert(ours); 
    168170  d_any_sem.post(); // kick the loop! 
    169171} 
     
    242244    if(!ssr.d_serials.count(di.id))  
    243245      continue; 
     246    if(!di.backend) // might've come from the packethandler 
     247      B->getDomainInfo(di.zone, di); 
    244248    uint32_t theirserial = ssr.d_serials[di.id], ourserial = di.serial; 
    245249