summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-25 15:16:53 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-25 15:16:53 +0000
commitaae22ceec57498656d95cf4461f16c9ce5ba98cc (patch)
treeb1eb861e4b2817940dcaa02382428155715de411 /src/couchdb
parenta61f2eb606d20aa4f790fe927cf31c5f96754527 (diff)
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
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_rep_db_listener.erl6
1 files changed, 4 insertions, 2 deletions
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