couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [04/27] couch-replicator commit: updated refs/heads/windsor-merge to 75e5ba1
Date Wed, 06 Aug 2014 18:17:54 GMT
Increase dt between heartbeat and inactive timeouts

The current theory is that on occasion the inactivity timeout in the
ibrowse client fires before the replicator receives a heartbeat line.
This patch replaces the 5 second delta with the "div 3" logic that
results in a 20 second delta by default.  This is the logic that we used
back when the replicator used heartbeats instead of timeouts to control
the frequency of heartbeat lines.

As an aside, the timeout value we're adjusting here actually serves a
dual purpose.  When a _changes response is streaming this parameter
controls the frequency of heartbeat newlines, useful e.g. for highly
selective filtered feeds.  In between streams of _changes it controls
how long the _changes coordinator will wait for updates to the DB before
terminating the response with a last_seq entry.

BugzID: 17709


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

Branch: refs/heads/windsor-merge
Commit: ed447f8c01880c7f99f5829a8ef485fd8d399376
Parents: 7898313
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Fri Apr 26 10:54:41 2013 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jul 29 13:18:32 2014 +0100

----------------------------------------------------------------------
 src/couch_replicator_api_wrap.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/ed447f8c/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_api_wrap.erl b/src/couch_replicator_api_wrap.erl
index bf37400..fa64377 100644
--- a/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator_api_wrap.erl
@@ -390,7 +390,7 @@ update_docs(Db, DocList, Options, UpdateType) ->
 
 changes_since(#httpdb{headers = Headers1, timeout = InactiveTimeout} = HttpDb,
               Style, StartSeq, UserFun, Options) ->
-    Timeout = erlang:max(1000, InactiveTimeout - 5000),
+    Timeout = erlang:max(1000, InactiveTimeout div 3),
     BaseQArgs = case get_value(continuous, Options, false) of
     false ->
         [{"feed", "normal"}];


Mime
View raw message