I'm cherry-picking this for 1.2. Especially with a brand new replicator, it would be very nice if no-one gets bitten by this doing filtered replication. Applies cleanly.
On Sat, Jan 7, 2012 at 05:48, <[email protected]> wrote: > Updated Branches: > refs/heads/master 975ea08c7 -> a2d57c8bb > > > Add heartbeat parameter to all _changes requests > > Even non-continuous _changes requests, particularly filtered > ones, can cause long periods of inactivity. > > > Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a2d57c8b > Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a2d57c8b > Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a2d57c8b > > Branch: refs/heads/master > Commit: a2d57c8bb34f4621fed00f4e65191a1531bc3110 > Parents: 975ea08 > Author: Filipe David Borba Manana <[email protected]> > Authored: Sat Jan 7 13:44:45 2012 +0000 > Committer: Filipe David Borba Manana <[email protected]> > Committed: Sat Jan 7 13:44:45 2012 +0000 > > ---------------------------------------------------------------------- > .../src/couch_replicator_api_wrap.erl | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2d57c8b/src/couch_replicator/src/couch_replicator_api_wrap.erl > ---------------------------------------------------------------------- > diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl > b/src/couch_replicator/src/couch_replicator_api_wrap.erl > index a29fe94..d287fcb 100644 > --- a/src/couch_replicator/src/couch_replicator_api_wrap.erl > +++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl > @@ -306,13 +306,15 @@ update_docs(Db, DocList, Options, UpdateType) -> > > changes_since(#httpdb{headers = Headers1} = HttpDb, Style, StartSeq, > UserFun, Options) -> > + HeartBeat = erlang:max(1000, HttpDb#httpdb.timeout div 3), > BaseQArgs = case get_value(continuous, Options, false) of > false -> > [{"feed", "normal"}]; > true -> > - [{"feed", "continuous"}, {"heartbeat", "10000"}] > + [{"feed", "continuous"}] > end ++ [ > - {"style", atom_to_list(Style)}, {"since", > couch_util:to_list(StartSeq)} > + {"style", atom_to_list(Style)}, {"since", > couch_util:to_list(StartSeq)}, > + {"heartbeat", integer_to_list(HeartBeat)} > ], > DocIds = get_value(doc_ids, Options), > {QArgs, Method, Body, Headers} = case DocIds of >
