From: Remi Gacogne Date: Thu, 21 Oct 2021 09:58:50 +0000 (+0200) Subject: dnsdist: Properly handle I/O exceptions in the health checker X-Git-Tag: rec-4.6.0-beta1~41^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9274445a349d13238337da8c8cbdf3c5b825f97;p=thirdparty%2Fpdns.git dnsdist: Properly handle I/O exceptions in the health checker --- diff --git a/pdns/dnsdistdist/dnsdist-healthchecks.cc b/pdns/dnsdistdist/dnsdist-healthchecks.cc index 1a7030f32d..f704eae3a9 100644 --- a/pdns/dnsdistdist/dnsdist-healthchecks.cc +++ b/pdns/dnsdistdist/dnsdist-healthchecks.cc @@ -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()); }