From e6389e47070e9fa9c749226b7c6ef6db3766b53b Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 11 Jul 2023 10:15:51 +0200 Subject: [PATCH] dnsdist: Add a couple comments in the health-check timeout handling code --- pdns/dnsdistdist/dnsdist-healthchecks.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdns/dnsdistdist/dnsdist-healthchecks.cc b/pdns/dnsdistdist/dnsdist-healthchecks.cc index cc73a9d754..4df42302f3 100644 --- a/pdns/dnsdistdist/dnsdist-healthchecks.cc +++ b/pdns/dnsdistdist/dnsdist-healthchecks.cc @@ -459,11 +459,15 @@ void handleQueuedHealthChecks(FDMultiplexer& mplexer, bool initial) data->d_ds->submitHealthCheckResult(initial, false); } catch (const std::exception& e) { + /* this is not supposed to happen as the file descriptor has to be + there for us to reach that code, and the submission code should not throw, + but let's provide a nice error message if it ever does. */ if (g_verboseHealthChecks) { infolog("Error while dealing with a timeout for the health check response (ID %d) from backend %s: %s", data->d_queryID, data->d_ds->getNameWithAddr(), e.what()); } } catch (...) { + /* this is even less likely to happen */ if (g_verboseHealthChecks) { infolog("Error while dealing with a timeout for the health check response (ID %d) from backend %s", data->d_queryID, data->d_ds->getNameWithAddr()); } @@ -487,11 +491,14 @@ void handleQueuedHealthChecks(FDMultiplexer& mplexer, bool initial) data->d_ds->submitHealthCheckResult(initial, false); } catch (const std::exception& e) { + /* this is not supposed to happen as the submission code should not throw, + but let's provide a nice error message if it ever does. */ if (g_verboseHealthChecks) { infolog("Error while dealing with a timeout for the health check response (ID %d) from backend %s: %s", data->d_queryID, data->d_ds->getNameWithAddr(), e.what()); } } catch (...) { + /* this is even less likely to happen */ if (g_verboseHealthChecks) { infolog("Error while dealing with a timeout for the health check response (ID %d) from backend %s", data->d_queryID, data->d_ds->getNameWithAddr()); } -- 2.47.2