couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [08/27] couch-replicator commit: updated refs/heads/windsor-merge to 75e5ba1
Date Wed, 06 Aug 2014 18:17:58 GMT
Make replication request timeout configurable

This is intended as a defensive measure against failures in code that's out
of our control, such as ibrowse.

BugzID: 20550


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

Branch: refs/heads/windsor-merge
Commit: 20b837e248e584bafece0b7c40353bc42b440592
Parents: 6acc906
Author: Benjamin Anderson <b@banjiewen.net>
Authored: Mon Jun 24 20:44:18 2013 -0700
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jul 29 13:48:29 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/20b837e2/src/couch_replicator_httpc.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_httpc.erl b/src/couch_replicator_httpc.erl
index 1f08750..6aeff93 100644
--- a/src/couch_replicator_httpc.erl
+++ b/src/couch_replicator_httpc.erl
@@ -61,8 +61,12 @@ send_ibrowse_req(#httpdb{headers = BaseHeaders} = HttpDb, Params) ->
         lists:ukeymerge(1, get_value(ibrowse_options, Params, []),
             HttpDb#httpdb.ibrowse_options)
     ],
+    Timeout = case config:get("replicator", "request_timeout", "infinity") of
+        "infinity" -> infinity;
+        Milliseconds -> list_to_integer(Milliseconds)
+    end,
     Response = ibrowse:send_req_direct(
-        Worker, Url, Headers2, Method, Body, IbrowseOptions, infinity),
+        Worker, Url, Headers2, Method, Body, IbrowseOptions, Timeout),
     {Worker, Response}.
 
 


Mime
View raw message