From: stutiredboy Date: Mon, 18 Jul 2016 09:48:08 +0000 (+0800) Subject: newServer setting maxCheckFailures makes no sense X-Git-Tag: rec-4.0.2~51^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81e5ed3ee048621411ae97d37c21af80736f0f8b;p=pdns newServer setting maxCheckFailures makes no sense --- 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;