couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonysu...@apache.org
Subject [2/2] couch-replicator commit: updated refs/heads/3010-handle-429 to 7f0f3d7
Date Mon, 30 May 2016 23:15:07 GMT
Add random for next wait in maybe_retry

COUCHDB-3010


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/7f0f3d7e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/7f0f3d7e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/7f0f3d7e

Branch: refs/heads/3010-handle-429
Commit: 7f0f3d7e883be81946f1dbc0108649fc81772964
Parents: 665b0a7
Author: Tony Sun <tony.sun@cloudant.com>
Authored: Mon May 30 16:17:09 2016 -0700
Committer: Tony Sun <tony.sun@cloudant.com>
Committed: Mon May 30 16:17:09 2016 -0700

----------------------------------------------------------------------
 src/couch_replicator_httpc.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/7f0f3d7e/src/couch_replicator_httpc.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_httpc.erl b/src/couch_replicator_httpc.erl
index 5013de3..f3fbd58 100644
--- a/src/couch_replicator_httpc.erl
+++ b/src/couch_replicator_httpc.erl
@@ -283,7 +283,8 @@ maybe_retry(Error, _Worker, #httpdb{retries = Retries, wait = Wait} =
HttpDb,
     % backwards compatibility.
     ok = timer:sleep(erlang:min(Wait, ?MAX_WAIT)),
     Wait2 = erlang:min(Wait * 2, ?MAX_WAIT),
-    NewHttpDb = HttpDb#httpdb{retries = Retries - 1, wait = Wait2},
+    WaitR = random:uniform(Wait2),
+    NewHttpDb = HttpDb#httpdb{retries = Retries - 1, wait = WaitR},
     throw({retry, NewHttpDb, Params}).
 
 


Mime
View raw message