From 145079464c3815d051f9283c01ce3c97e46425f8 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 15 May 2026 15:39:55 +0200 Subject: [PATCH 1/3] dnsdist: Fix DownstreamState::setHealthCheckParams We cannot rely on the value of the variable being different from 0 since we reuse it for all options. Signed-off-by: Remi Gacogne (cherry picked from commit 881da6dea4b20038d957f23baca4f482d7341648) --- pdns/dnsdistdist/dnsdist-lua-bindings.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-lua-bindings.cc b/pdns/dnsdistdist/dnsdist-lua-bindings.cc index caae6606fafe..8044769698ce 100644 --- a/pdns/dnsdistdist/dnsdist-lua-bindings.cc +++ b/pdns/dnsdistdist/dnsdist-lua-bindings.cc @@ -293,20 +293,16 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck) return; } size_t value = 0; - getOptionalValue(vars, "maxCheckFailures", value); - if (value > 0) { + if (getOptionalValue(vars, "maxCheckFailures", value) > 0 && value > 0) { state->d_config.maxCheckFailures.store(value); } - getOptionalValue(vars, "rise", value); - if (value > 0) { + if (getOptionalValue(vars, "rise", value) > 0 && value > 0) { state->d_config.minRiseSuccesses.store(value); } - getOptionalValue(vars, "checkTimeout", value); - if (value > 0) { + if (getOptionalValue(vars, "checkTimeout", value) && value > 0) { state->d_config.checkTimeout.store(value); } - getOptionalValue(vars, "checkInterval", value); - if (value > 0) { + if (getOptionalValue(vars, "checkInterval", value) > 0 && value > 0) { state->d_config.checkInterval.store(value); } }); From 0e9f6483eb16600fa0a0ab04038afacf8f9177f2 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 15 May 2026 16:54:39 +0200 Subject: [PATCH 2/3] dnsdist: Fix a bug caught by clang-tidy Signed-off-by: Remi Gacogne (cherry picked from commit cab10e635d18ef13a0aea102cf183f8a1119cd5a) --- pdns/dnsdistdist/dnsdist-lua-bindings.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/dnsdist-lua-bindings.cc b/pdns/dnsdistdist/dnsdist-lua-bindings.cc index 8044769698ce..bf7323f03a55 100644 --- a/pdns/dnsdistdist/dnsdist-lua-bindings.cc +++ b/pdns/dnsdistdist/dnsdist-lua-bindings.cc @@ -299,7 +299,7 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck) if (getOptionalValue(vars, "rise", value) > 0 && value > 0) { state->d_config.minRiseSuccesses.store(value); } - if (getOptionalValue(vars, "checkTimeout", value) && value > 0) { + if (getOptionalValue(vars, "checkTimeout", value) > 0 && value > 0) { state->d_config.checkTimeout.store(value); } if (getOptionalValue(vars, "checkInterval", value) > 0 && value > 0) { From 2b3343146b09991add3fb1a85288de68adf45d03 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 18 May 2026 14:40:02 +0200 Subject: [PATCH 3/3] dnsdist: Hopefully fixes spurious failures of TestHealthCheckLatency Signed-off-by: Remi Gacogne (cherry picked from commit 1a8b7bfb6a986d65027bee500f118965be990f40) --- regression-tests.dnsdist/test_HealthChecks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/regression-tests.dnsdist/test_HealthChecks.py b/regression-tests.dnsdist/test_HealthChecks.py index 9f536b199ff6..95df8b199862 100644 --- a/regression-tests.dnsdist/test_HealthChecks.py +++ b/regression-tests.dnsdist/test_HealthChecks.py @@ -669,6 +669,13 @@ def testLatency(self): # introduce 500 ms of latency self.setDelay(0.5) + # consume any value received in the meantime (it does happen on GH actions runners) + try: + while self.wait1(False): + pass + except queue.Empty: + pass + self.wait1(True) # should have no failures, still up