]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Properly handle I/O exceptions in the health checker
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 21 Oct 2021 09:58:50 +0000 (11:58 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 21 Oct 2021 09:58:50 +0000 (11:58 +0200)
pdns/dnsdistdist/dnsdist-healthchecks.cc

index 1a7030f32d3a6ba2c534dbe487a45611615d029e..f704eae3a987ddce394eb34de0658c9134332704 100644 (file)
@@ -296,11 +296,13 @@ static void healthCheckTCPCallback(int fd, FDMultiplexer::funcparam_t& param)
     ioGuard.release();
   }
   catch (const std::exception& e) {
+    updateHealthCheckResult(data->d_ds, data->d_initial, false);
     if (g_verboseHealthChecks) {
       infolog("Error checking the health of backend %s: %s", data->d_ds->getNameWithAddr(), e.what());
     }
   }
   catch (...) {
+    updateHealthCheckResult(data->d_ds, data->d_initial, false);
     if (g_verboseHealthChecks) {
       infolog("Unknown exception while checking the health of backend %s", data->d_ds->getNameWithAddr());
     }