From 472cba766a9c49fa9739a52cd317082d98194c13 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 2 Feb 2022 09:06:42 +0100 Subject: [PATCH] Move the pruning of the two now shared maps (failed servers and non-resolving ns) to the handler thread --- pdns/recursordist/rec-main.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 202223fee4..c44edd4024 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -1797,14 +1797,11 @@ static void houseKeeping(void*) limit = now.tv_sec - 300; SyncRes::pruneNSSpeeds(limit); } - limit = now.tv_sec - SyncRes::s_serverdownthrottletime * 10; - SyncRes::pruneFailedServers(limit); limit = now.tv_sec - 2 * 3600; SyncRes::pruneEDNSStatuses(limit); SyncRes::pruneThrottledServers(); - SyncRes::pruneNonResolving(now.tv_sec - SyncRes::s_nonresolvingnsthrottletime); - Utility::gettimeofday(&t_last_prune, nullptr); t_tcp_manager.cleanup(now); + Utility::gettimeofday(&t_last_prune, nullptr); } if (isHandlerThread()) { @@ -1823,6 +1820,8 @@ static void houseKeeping(void*) if (g_aggressiveNSECCache) { g_aggressiveNSECCache->prune(now.tv_sec); } + SyncRes::pruneFailedServers(now.tv_sec - SyncRes::s_serverdownthrottletime * 10); + SyncRes::pruneNonResolving(now.tv_sec - SyncRes::s_nonresolvingnsthrottletime); s_last_RC_prune = now.tv_sec; } // Divide by 12 to get the original 2 hour cycle if s_maxcachettl is default (1 day) -- 2.47.3