]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
avoid race condition, also avoid a rare crash. Patch from ticket #596
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 11 Oct 2012 13:41:42 +0000 (13:41 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 11 Oct 2012 13:41:42 +0000 (13:41 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2802 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/slavecommunicator.cc

index aae39516a2d58a1164311b067d806d13b4be696f..368433a4cbd48995e85b4e7e479b63c784388d14 100644 (file)
@@ -577,8 +577,12 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P)
   typedef DomainNotificationInfo val_t;
   BOOST_FOREACH(val_t& val, sdomains) {
     DomainInfo& di(val.di);
-    if(!di.backend) // might've come from the packethandler
-      B->getDomainInfo(di.zone, di);
+    // might've come from the packethandler
+    if(!di.backend && !B->getDomainInfo(di.zone, di)) {
+       L<<Logger::Warning<<"Ignore domain "<< di.zone<<" since it has been removed from our backend"<<endl;
+       continue;
+    }
+      
     if(!ssr.d_freshness.count(di.id)) 
       continue;
     uint32_t theirserial = ssr.d_freshness[di.id].theirSerial, ourserial = di.serial;