From aae22ceec57498656d95cf4461f16c9ce5ba98cc Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Thu, 25 Nov 2010 15:16:53 +0000 Subject: Merged revision 1039069 from trunk: Replicator DB: proper handling of the changes loop process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1039070 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_db_listener.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_rep_db_listener.erl index bd47ac8f..6e9e6354 100644 --- a/src/couchdb/couch_rep_db_listener.erl +++ b/src/couchdb/couch_rep_db_listener.erl @@ -63,14 +63,14 @@ handle_cast(rep_db_changed, State) -> changes_feed_loop = Loop, changes_queue = Queue } = State, - unlink(Loop), + catch unlink(Loop), catch exit(Loop, rep_db_changed), couch_work_queue:queue(Queue, stop_all_replications), {ok, NewLoop} = changes_feed_loop(Queue), {noreply, State#state{changes_feed_loop = NewLoop}}; handle_cast(rep_db_created, #state{changes_feed_loop = Loop} = State) -> - unlink(Loop), + catch unlink(Loop), catch exit(Loop, rep_db_changed), {ok, NewLoop} = changes_feed_loop(State#state.changes_queue), {noreply, State#state{changes_feed_loop = NewLoop}}; @@ -79,6 +79,8 @@ handle_cast(Msg, State) -> ?LOG_ERROR("Replicator DB listener received unexpected cast ~p", [Msg]), {stop, {error, {unexpected_cast, Msg}}, State}. +handle_info({'EXIT', _OldChangesLoop, rep_db_changed}, State) -> + {noreply, State}; handle_info({'EXIT', From, normal}, #state{changes_feed_loop = From} = State) -> % replicator DB deleted -- cgit v1.2.3