From d35cbb3032767ebe2632b9be69f1b88f8522639e Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sat, 24 Jan 2009 11:39:21 +0000 Subject: Don't let a failing db update notification client bring down the entire view_server. Patch by Adam Kocoloski. Closes COUCHDB-206. Thanks Adam. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@737334 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_db_update_notifier.erl | 6 +++++- src/couchdb/couch_os_process.erl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_db_update_notifier.erl b/src/couchdb/couch_db_update_notifier.erl index ef50e704..a1019556 100644 --- a/src/couchdb/couch_db_update_notifier.erl +++ b/src/couchdb/couch_db_update_notifier.erl @@ -63,7 +63,11 @@ handle_call(_Request, State) -> handle_info({'EXIT', Pid, Reason}, Pid) -> ?LOG_ERROR("Update notification process ~p died: ~p", [Pid, Reason]), - {stop, nil}. + remove_handler; +handle_info({'EXIT', _, _}, Pid) -> + %% the db_update event manager traps exits and forwards this message to all + %% its handlers. Just ignore as it wasn't our os_process that exited. + {ok, Pid}. code_change(_OldVsn, State, _Extra) -> {ok, State}. diff --git a/src/couchdb/couch_os_process.erl b/src/couchdb/couch_os_process.erl index c0b98946..63cc07b0 100644 --- a/src/couchdb/couch_os_process.erl +++ b/src/couchdb/couch_os_process.erl @@ -151,7 +151,7 @@ handle_cast(Msg, OsProc) -> handle_info({Port, {exit_status, Status}}, #os_proc{port=Port}=OsProc) -> ?LOG_ERROR("OS Process died with status: ~p", [Status]), - {stop, error, OsProc}; + {stop, {exit_status, Status}, OsProc}; handle_info(Msg, OsProc) -> ?LOG_DEBUG("OS Proc: Unknown info: ~p", [Msg]), {noreply, OsProc}. -- cgit v1.2.3