]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
avoid busy looping on incoming notify storm
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 20 Jun 2019 08:42:55 +0000 (10:42 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 20 Jun 2019 08:42:55 +0000 (10:42 +0200)
pdns/communicator.cc

index 48f481dcf5c131a5fda113cb847cefa70a3da857..d47360eb7e51076cc2bf568961386462bfd20751 100644 (file)
@@ -120,7 +120,10 @@ void CommunicatorClass::mainloop(void)
 
         if(rc)
           Utility::sleep(1);
-        else { 
+        else {
+          // eat up extra posts to avoid busy looping if many posts were done
+          while (d_any_sem.tryWait() == 0) {
+          }
           break; // something happened
         }
         // this gets executed at least once every second