From 9a0f37a7f99b22f133f3f1c333964dd793eec337 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 18 Nov 2022 16:56:47 +0100 Subject: [PATCH] dnsdist: Keep the local copy of the downstream servers around --- pdns/dnsdist.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index d0b3fbec93..5ba75b4bb7 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1942,13 +1942,12 @@ static void healthChecksThread() setThreadName("dnsdist/healthC"); constexpr int interval = 1; + auto states = g_dstates.getLocal(); // this points to the actual shared_ptrs! for (;;) { sleep(interval); std::unique_ptr mplexer{nullptr}; - - auto states = g_dstates.getLocal(); // this points to the actual shared_ptrs! for (auto& dss : *states) { auto delta = dss->sw.udiffAndSet()/1000000.0; dss->queryLoad.store(1.0*(dss->queries.load() - dss->prev.queries.load())/delta); -- 2.47.2