couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonysu...@apache.org
Subject [3/5] couch-replicator commit: updated refs/heads/master to cb41bac
Date Wed, 05 Oct 2016 17:31:49 GMT
Fix timeout clause in backoff retry

The second clause for a timeout will never be reached because the first
will always match before the second clause. Switching the clauses to
fix this.

BugzId:70400
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/a51561c1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/a51561c1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/a51561c1

Branch: refs/heads/master
Commit: a51561c1e07e63371cef4f797f063028b4c61999
Parents: 2db0d7f
Author: Tony Sun <tony.sun@cloudant.com>
Authored: Wed Jul 20 21:55:26 2016 -0700
Committer: Tony Sun <tony.sun@cloudant.com>
Committed: Wed Sep 21 11:39:53 2016 -0700

----------------------------------------------------------------------
 src/couch_replicator_httpc.erl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/a51561c1/src/couch_replicator_httpc.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_httpc.erl b/src/couch_replicator_httpc.erl
index 366c325..1b1ea3f 100644
--- a/src/couch_replicator_httpc.erl
+++ b/src/couch_replicator_httpc.erl
@@ -277,12 +277,12 @@ backoff(Worker, #httpdb{backoff = Backoff} = HttpDb, Params) ->
     NewBackoff = erlang:min(Backoff2, ?MAX_BACKOFF_WAIT),
     NewHttpDb = HttpDb#httpdb{backoff = NewBackoff},
     case Backoff2 of
-        W0 when W0 >= ?MAX_BACKOFF_LOG_THRESHOLD -> % Past 8 min, we log retries
+        W0 when W0 > ?MAX_BACKOFF_WAIT ->
+            report_error(Worker, HttpDb, Params, {error,
+                "Long 429-induced Retry Time Out"});
+        W1 when W1 >= ?MAX_BACKOFF_LOG_THRESHOLD -> % Past 8 min, we log retries
             log_retry_error(Params, HttpDb, Backoff2, "429 Retry"),
             throw({retry, NewHttpDb, Params});
-        W1 when W1 > ?MAX_BACKOFF_WAIT ->
-            report_error(Worker, HttpDb, Params, {error,
-                "429 Retry Timeout"});
         _ ->
             throw({retry, NewHttpDb, Params})
     end.


Mime
View raw message