From: Peter van Dijk Date: Thu, 20 Jun 2019 08:42:55 +0000 (+0200) Subject: avoid busy looping on incoming notify storm X-Git-Tag: auth-4.0.8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c2476aefba4a4d422e30e20c04118d201b91f0;p=thirdparty%2Fpdns.git avoid busy looping on incoming notify storm --- diff --git a/pdns/communicator.cc b/pdns/communicator.cc index 48f481dcf5..d47360eb7e 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -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