Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DAD0CFF9 for ; Fri, 25 May 2012 13:29:30 +0000 (UTC) Received: (qmail 30579 invoked by uid 500); 25 May 2012 13:29:30 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 30392 invoked by uid 500); 25 May 2012 13:29:29 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 30116 invoked by uid 99); 25 May 2012 13:29:29 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 13:29:29 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 20E8417E11; Fri, 25 May 2012 13:29:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: fdmanana@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Avoid possible timeout initializing replications Message-Id: <20120525132929.20E8417E11@tyr.zones.apache.org> Date: Fri, 25 May 2012 13:29:29 +0000 (UTC) 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 Authored: Fri Apr 13 12:13:41 2012 +0100 Committer: Filipe David Borba Manana 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,