]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Properly handle the initial failure in 'lazy' mode
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 18 Oct 2022 13:46:19 +0000 (15:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 20 Oct 2022 12:31:02 +0000 (14:31 +0200)
pdns/dnsdistdist/dnsdist-backend.cc

index a93d36d01d1194fdfff2977cccf0993bb258f99f..dd6886048fec17c959aeda63c77b7f470513f210 100644 (file)
@@ -612,6 +612,11 @@ void DownstreamState::submitHealthCheckResult(bool initial, bool newResult)
       infolog("Marking downstream %s as '%s'", getNameWithAddr(), newResult ? "up" : "down");
     }
     setUpStatus(newResult);
+    if (newResult == false) {
+      auto stats = d_lazyHealthCheckStats.lock();
+      stats->d_status = LazyHealthCheckStats::LazyStatus::Failed;
+      updateNextLazyHealthCheck(*stats);
+    }
     return;
   }