couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [couchdb] branch 63012-scheduler updated: [fixup] comment for scheduler backoff math
Date Mon, 10 Apr 2017 19:40:36 GMT
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch 63012-scheduler
in repository https://gitbox.apache.org/repos/asf/couchdb.git

The following commit(s) were added to refs/heads/63012-scheduler by this push:
       new  7121102   [fixup] comment for scheduler backoff math
7121102 is described below

commit 712110230e9812bdcfab0748339cd63feaeffcb5
Author: Nick Vatamaniuc <vatamane@apache.org>
AuthorDate: Mon Apr 10 15:40:31 2017 -0400

    [fixup] comment for scheduler backoff math
---
 src/couch_replicator/src/couch_replicator_scheduler.erl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/couch_replicator/src/couch_replicator_scheduler.erl b/src/couch_replicator/src/couch_replicator_scheduler.erl
index b629cbb..ce17e58 100644
--- a/src/couch_replicator/src/couch_replicator_scheduler.erl
+++ b/src/couch_replicator/src/couch_replicator_scheduler.erl
@@ -525,6 +525,10 @@ latest_crash_timestamp([_Event | Rest]) ->
 
 -spec backoff_micros(non_neg_integer()) -> non_neg_integer().
 backoff_micros(CrashCount) ->
+    % When calculating the backoff interval treat consecutive crash count as the
+    % exponent in Base * 2 ^ CrashCount to achieve an exponential backoff
+    % doubling every consecutive failure, starting with the base value of
+    % ?BACKOFF_INTERVAL_MICROS.
     BackoffExp = erlang:min(CrashCount - 1, ?MAX_BACKOFF_EXPONENT),
     (1 bsl BackoffExp) * ?BACKOFF_INTERVAL_MICROS.
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <commits@couchdb.apache.org>'].

Mime
View raw message