You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2016/10/05 17:31:49 UTC
[3/5] couch-replicator commit: updated refs/heads/master to cb41bac
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 <to...@cloudant.com>
Authored: Wed Jul 20 21:55:26 2016 -0700
Committer: Tony Sun <to...@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.