From 5cc6a89b88454b935085a8b32dc4004cfecc0b06 Mon Sep 17 00:00:00 2001 From: Otto Date: Fri, 5 Feb 2021 16:00:33 +0100 Subject: [PATCH] Catch exception on stats entries init and exit on that --- pdns/rec_channel_rec.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 8bdfbfaab2..0bcc47238e 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -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) -- 2.47.2