From: Remi Gacogne Date: Fri, 18 Nov 2022 15:56:47 +0000 (+0100) Subject: dnsdist: Keep the local copy of the downstream servers around X-Git-Tag: dnsdist-1.8.0-rc1~196^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a0f37a7f99b22f133f3f1c333964dd793eec337;p=thirdparty%2Fpdns.git dnsdist: Keep the local copy of the downstream servers around --- 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);