From: Remi Gacogne Date: Tue, 7 Nov 2017 10:40:30 +0000 (+0100) Subject: rec: Don't retry security polling too often when it fails X-Git-Tag: auth-4.1.0-rc3~21^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=491d5d97c907be9619910ee22646c8da911d0256;p=pdns rec: Don't retry security polling too often when it fails --- diff --git a/pdns/secpoll-recursor.cc b/pdns/secpoll-recursor.cc index 88145d16e..c7b6d47d4 100644 --- a/pdns/secpoll-recursor.cc +++ b/pdns/secpoll-recursor.cc @@ -24,6 +24,11 @@ void doSecPoll(time_t* last_secpoll) string pkgv(PACKAGEVERSION); struct timeval now; gettimeofday(&now, 0); + + /* update last_secpoll right now, even if it fails + we don't want to retry right away and hammer the server */ + *last_secpoll=now.tv_sec; + SyncRes sr(now); if (g_dnssecmode != DNSSECMode::Off) { sr.setDoDNSSEC(true); @@ -67,7 +72,6 @@ void doSecPoll(time_t* last_secpoll) g_security_status = std::stoi(split.first); g_security_message = split.second; - *last_secpoll=now.tv_sec; } else { if(pkgv.find("0.0.") != 0) @@ -77,8 +81,6 @@ void doSecPoll(time_t* last_secpoll) if(g_security_status == 1) // it was ok, now it is unknown g_security_status = 0; - if(res == RCode::NXDomain) // if we had NXDOMAIN, keep on trying more more frequently - *last_secpoll=now.tv_sec; } if(g_security_status == 2) {