From 6b0d90ea6ed92fdd36c82352c0d44aeaf6415d1b Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 18 Apr 2019 10:23:47 +0200 Subject: [PATCH] rec: Fix the cache cleaning code being only run once for workers --- pdns/pdns_recursor.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index a0dda978a..aa20a8c74 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -2673,16 +2673,15 @@ static void houseKeeping(void *) } try { - if(s_running) + if(s_running) { return; + } s_running=true; struct timeval now; Utility::gettimeofday(&now, 0); if(now.tv_sec - last_prune > (time_t)(5 + t_id)) { - DTime dt; - dt.setTimeval(now); t_RC->doPrune(g_maxCacheEntries / g_numThreads); // this function is local to a thread, so fine anyhow t_packetCache->doPruneTo(g_maxPacketCacheEntries / g_numWorkerThreads); @@ -2740,8 +2739,8 @@ static void houseKeeping(void *) g_log<