From: Klaus Darilion Date: Wed, 1 Aug 2018 10:57:36 +0000 (+0000) Subject: add d_lock while manipulating d_failedSlaveRefresh X-Git-Tag: dnsdist-1.3.3~84^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd73b2644091ac15ee6323007f09c25d090e366b;p=thirdparty%2Fpdns.git add d_lock while manipulating d_failedSlaveRefresh --- diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index ec5cfb4d02..30316c276f 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -615,17 +615,20 @@ void CommunicatorClass::suck(const DNSName &domain, const ComboAddress& remote) } } catch(ResolverException &re) { - // The AXFR probably failed due to a problem on the master server. If SOA-checks against this master - // still succeed, we would constantly try to AXFR the zone. To avoid this, we add the zone to the list of - // failed slave-checks. This will suspend slave-checks (and subsequent AXFR) for this zone for some time. - uint64_t newCount = 1; - time_t now = time(0); - const auto failedEntry = d_failedSlaveRefresh.find(domain); - if (failedEntry != d_failedSlaveRefresh.end()) - newCount = d_failedSlaveRefresh[domain].first + 1; - time_t nextCheck = now + std::min(newCount * d_tickinterval, (uint64_t)::arg().asNum("soa-retry-default")); - d_failedSlaveRefresh[domain] = {newCount, nextCheck}; - g_log<abortTransaction();