Updated Branches: refs/heads/master a6eaf9f15 -> e4d3e15ca
Avoid possible timeout initializing replications If 2 different replications start and finish at about the same time, there's a chance one is doing a synchronous gen_server call to the replication manager (to notify it that it started) while the replication manager is doing a call to the replication supervisor because the other replication just finished. COUCHDB-1461 Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e4d3e15c Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e4d3e15c Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e4d3e15c Branch: refs/heads/master Commit: e4d3e15ca451e59e9c3ae2993257328e332bc71b Parents: a6eaf9f Author: Filipe David Borba Manana <[email protected]> Authored: Fri Apr 13 12:13:41 2012 +0100 Committer: Filipe David Borba Manana <[email protected]> Committed: Fri May 25 13:28:07 2012 +0100 ---------------------------------------------------------------------- .../src/couch_replicator_manager.erl | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/e4d3e15c/src/couch_replicator/src/couch_replicator_manager.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_manager.erl b/src/couch_replicator/src/couch_replicator_manager.erl index 499e3bf..15d6255 100644 --- a/src/couch_replicator/src/couch_replicator_manager.erl +++ b/src/couch_replicator/src/couch_replicator_manager.erl @@ -431,7 +431,14 @@ replication_complete(DocId) -> % We want to be able to start the same replication but with % eventually different values for parameters that don't % contribute to its ID calculation. - _ = supervisor:delete_child(couch_replicator_job_sup, BaseId ++ Ext); + case erlang:system_info(otp_release) < "R14B02" of + true -> + spawn(fun() -> + _ = supervisor:delete_child(couch_replicator_job_sup, BaseId ++ Ext) + end); + false -> + ok + end; #rep_state{} -> ok end,
