diff --git a/pdns/dnsdistdist/dnsdist-lua-bindings.cc b/pdns/dnsdistdist/dnsdist-lua-bindings.cc index caae6606fafe..bf7323f03a55 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) > 0 && 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); } }); 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