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 2017/07/28 18:11:53 UTC

[couchdb] 01/02: Do not unconditioanlly retry a request which was closed unexpectedly

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

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

commit 058e674bd202cfc8ddbb981c48060fd8bc5c2001
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Fri Jul 28 04:52:12 2017 +0000

    Do not unconditioanlly retry a request which was closed unexpectedly
    
    In some case such as when replicator flushes a document received from an
    open_revs response, it explictly sets the number of retries to 0 because
    the context for that request might not be restartable and the retry should
    happen at a higher level.
    
    Issue #574
---
 src/couch_replicator/src/couch_replicator_httpc.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl b/src/couch_replicator/src/couch_replicator_httpc.erl
index 58fb0e1..d3c6b01 100644
--- a/src/couch_replicator/src/couch_replicator_httpc.erl
+++ b/src/couch_replicator/src/couch_replicator_httpc.erl
@@ -128,8 +128,10 @@ stop_and_release_worker(Pool, Worker) ->
     end,
     ok = couch_replicator_httpc_pool:release_worker_sync(Pool, Worker).
 
-process_response({error, sel_conn_closed}, _Worker, HttpDb, Params, _Cb) ->
-    throw({retry, HttpDb, Params});
+process_response({error, sel_conn_closed}, Worker, HttpDb, Params, _Cb) ->
+    stop_and_release_worker(HttpDb#httpdb.httpc_pool, Worker),
+    maybe_retry(sel_conn_closed, Worker, HttpDb, Params);
+
 
 %% This clause handles un-expected connection closing during pipelined requests.
 %% For example, if server responds to a request, sets Connection: close header

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