From a1c2476aefba4a4d422e30e20c04118d201b91f0 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 20 Jun 2019 10:42:55 +0200 Subject: [PATCH] avoid busy looping on incoming notify storm --- pdns/communicator.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.47.2