From 81e5ed3ee048621411ae97d37c21af80736f0f8b Mon Sep 17 00:00:00 2001 From: stutiredboy Date: Mon, 18 Jul 2016 17:48:08 +0800 Subject: [PATCH] newServer setting maxCheckFailures makes no sense --- pdns/dnsdist.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index a0a550dca..1cf00bc10 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1254,7 +1254,12 @@ void* healthChecksThread() for(auto& dss : g_dstates.getCopy()) { // this points to the actual shared_ptrs! if(dss->availability==DownstreamState::Availability::Auto) { bool newState=upCheck(*dss); - if (!newState && dss->upStatus) { + if (newState) { + if (dss->currentCheckFailures != 0) { + dss->currentCheckFailures = 0; + } + } + else if (!newState && dss->upStatus) { dss->currentCheckFailures++; if (dss->currentCheckFailures < dss->maxCheckFailures) { newState = true; -- 2.40.0