From 0ac327bc7aefda08d08b247fa1d7da434ed94d42 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 22 Jun 2020 15:07:08 +0200 Subject: [PATCH] rec: Better exception handling in houseKeeping An uncaugth exception being raised in houseKeeping could prevent it from being run again because 's_running' would stay true. That could for example happen when an ImmediateServFailException was raised during a call to primeRootNSZones(). --- pdns/pdns_recursor.cc | 50 ++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index cd336817df..a13434dcfc 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3187,7 +3187,25 @@ static void houseKeeping(void *) int res = SyncRes::getRootNS(g_now, nullptr, 0); if (!res) { last_rootupdate=now.tv_sec; - primeRootNSZones(g_dnssecmode != DNSSECMode::Off, 0); + try { + primeRootNSZones(g_dnssecmode != DNSSECMode::Off, 0); + } + catch (const std::exception& e) { + g_log<