]> granicus.if.org Git - pdns/commitdiff
newServer setting maxCheckFailures makes no sense
authorstutiredboy <stutiredboy@gmail.com>
Mon, 18 Jul 2016 09:48:08 +0000 (17:48 +0800)
committerstutiredboy <stutiredboy@gmail.com>
Mon, 18 Jul 2016 09:48:08 +0000 (17:48 +0800)
pdns/dnsdist.cc

index a0a550dca19cd52c4818f7c46ebdae2969d7a7cd..1cf00bc1073fc915967e8771b6132433677bbdbf 100644 (file)
@@ -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;