You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2026/09/28 19:25:18 UTC

(couchdb) branch fix-scanner-backoff created (now 22711814b)

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

nickva pushed a change to branch fix-scanner-backoff
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 22711814b Fix scanner backoff logic

This branch includes the following new commits:

     new 22711814b Fix scanner backoff logic

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(couchdb) 01/01: Fix scanner backoff logic

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to branch fix-scanner-backoff
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 22711814baae75c97f4d69db3298f70360153c9d
Author: Nick Vatamaniuc <va...@gmail.com>
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.
---
 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 ecb7e73f0..6bd6ef39f 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.