This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to branch 3.5.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 147b8f464aa605e21cd9652b604f64627d5df0aa
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Mon Sep 28 15:23:39 2026 -0400

    Fix scanner backoff logic
    
    It was inverted before. We want to "forgive it" if it worked fine a while 
so we
    want the Now-Start to to be greater than our heal interval.
    
    (cherry picked from commit 39963bf9805964ed2f6f14c2669aa25392379a52)
---
 src/couch_scanner/src/couch_scanner_server.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/couch_scanner/src/couch_scanner_server.erl 
b/src/couch_scanner/src/couch_scanner_server.erl
index 2ec1ac540..1891bf159 100644
--- a/src/couch_scanner/src/couch_scanner_server.erl
+++ b/src/couch_scanner/src/couch_scanner_server.erl
@@ -266,7 +266,7 @@ sched_exit_update(Id, #sched{} = Sched, Error) ->
     Now = tsec(),
     % If process has been running successfully for a while without crashing
     % reset (forgive) its previous errors.
-    case Now - Start =< heal_threshold_sec() of
+    case Now - Start > heal_threshold_sec() of
         true -> penalize(Now, Sched1#sched{error_count = 1});
         false -> penalize(Now, Sched1#sched{error_count = ErrorCount + 1})
     end.

Reply via email to