Author: fdmanana Date: Thu Nov 25 15:16:53 2010 New Revision: 1039070 URL: http://svn.apache.org/viewvc?rev=1039070&view=rev Log: Merged revision 1039069 from trunk:
Replicator DB: proper handling of the changes loop process. Modified: couchdb/branches/1.1.x/src/couchdb/couch_rep_db_listener.erl Modified: couchdb/branches/1.1.x/src/couchdb/couch_rep_db_listener.erl URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_rep_db_listener.erl?rev=1039070&r1=1039069&r2=1039070&view=diff ============================================================================== --- couchdb/branches/1.1.x/src/couchdb/couch_rep_db_listener.erl (original) +++ couchdb/branches/1.1.x/src/couchdb/couch_rep_db_listener.erl Thu Nov 25 15:16:53 2010 @@ -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