From 491d5d97c907be9619910ee22646c8da911d0256 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 7 Nov 2017 11:40:30 +0100 Subject: [PATCH] rec: Don't retry security polling too often when it fails --- pdns/secpoll-recursor.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) { -- 2.40.0