couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [25/37] couch-replicator commit: updated refs/heads/master to aafb5f9
Date Thu, 28 Aug 2014 12:15:56 GMT
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/master
Commit: f90b6e0ee0dceca7d43c1694353e2784afb92cb6
Parents: 0ae9e60
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Thu Jan 30 20:01:19 2014 -0600
Committer: Robert Newson <rnewson@apache.org>
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};


Mime
View raw message