]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Catch exception on stats entries init and exit on that 10022/head
authorOtto <otto.moerbeek@open-xchange.com>
Fri, 5 Feb 2021 15:00:33 +0000 (16:00 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Fri, 5 Feb 2021 15:00:33 +0000 (16:00 +0100)
pdns/rec_channel_rec.cc

index 8bdfbfaab2f1f17aeeb6dbbc337ddc54fb33b237..0bcc47238eb868c6db0cd04edf132837a426626d 100644 (file)
@@ -1248,7 +1248,14 @@ static void registerAllStats1()
 void registerAllStats()
 {
   static std::once_flag s_once;
-  std::call_once(s_once, registerAllStats1);
+  std::call_once(s_once, []() { try {
+        registerAllStats1();
+      }
+      catch (...) {
+        g_log << Logger::Critical << "Could not add stat entries" << endl;
+        exit(1);
+      }
+  });
 }
 
 void doExitGeneric(bool nicely)