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 1819A116D2 for ; Thu, 28 Aug 2014 17:30:09 +0000 (UTC) Received: (qmail 13731 invoked by uid 500); 28 Aug 2014 17:30:03 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 13564 invoked by uid 500); 28 Aug 2014 17:30:02 -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 12733 invoked by uid 99); 28 Aug 2014 17:30:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2014 17:30:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4B727A04B0B; Thu, 28 Aug 2014 17:30:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chewbranca@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 17:30:24 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] couch-replicator commit: updated refs/heads/1963-eunit-bigcouch to 3cf0b13 Don't die when a known replicator related pid dies The couch_replicator_manager would die when any replication related pid exited. Instead of that we don't. This means we don't cancel and restart all known replications that happen to be running on the node due to an error starting replications for a given database or document. BugzId: 27666 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/f90b6e0e Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/f90b6e0e Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/f90b6e0e Branch: refs/heads/1963-eunit-bigcouch Commit: f90b6e0ee0dceca7d43c1694353e2784afb92cb6 Parents: 0ae9e60 Author: Paul J. Davis Authored: Thu Jan 30 20:01:19 2014 -0600 Committer: Robert Newson Committed: Thu Jul 31 11:56:41 2014 +0100 ---------------------------------------------------------------------- src/couch_replicator_manager.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/f90b6e0e/src/couch_replicator_manager.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl index 21e759f..bcb6462 100644 --- a/src/couch_replicator_manager.erl +++ b/src/couch_replicator_manager.erl @@ -234,6 +234,18 @@ handle_info({'EXIT', From, normal}, #state{rep_start_pids = Pids} = State) -> % one of the replication start processes terminated successfully {noreply, State#state{rep_start_pids = Pids -- [From]}}; +handle_info({'EXIT', From, Reason}, #state{rep_start_pids = Pids} = State) -> + case lists:member(From, Pids) of + true -> + Fmt = "~s : Known replication pid ~w died :: ~w", + couch_log:error(Fmt, [?MODULE, From, Reason]), + {noreply, State#state{rep_start_pids = Pids -- [From]}}; + false -> + Fmt = "~s : Unknown pid ~w died :: ~w", + couch_log:error(Fmt, [?MODULE, From, Reason]), + {stop, {unexpected_exit, From, Reason}, State} + end; + handle_info({'DOWN', _Ref, _, _, _}, State) -> % From a db monitor created by a replication process. Ignore. {noreply, State};