You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2009/01/24 12:39:22 UTC
svn commit: r737334 - in /couchdb/trunk/src/couchdb:
couch_db_update_notifier.erl couch_os_process.erl
Author: jan
Date: Sat Jan 24 11:39:21 2009
New Revision: 737334
URL: http://svn.apache.org/viewvc?rev=737334&view=rev
Log:
Don't let a failing db update notification client bring down the entire
view_server. Patch by Adam Kocoloski. Closes COUCHDB-206.
Thanks Adam.
Modified:
couchdb/trunk/src/couchdb/couch_db_update_notifier.erl
couchdb/trunk/src/couchdb/couch_os_process.erl
Modified: couchdb/trunk/src/couchdb/couch_db_update_notifier.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_update_notifier.erl?rev=737334&r1=737333&r2=737334&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_update_notifier.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_update_notifier.erl Sat Jan 24 11:39:21 2009
@@ -63,7 +63,11 @@
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}.
Modified: couchdb/trunk/src/couchdb/couch_os_process.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_os_process.erl?rev=737334&r1=737333&r2=737334&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_os_process.erl (original)
+++ couchdb/trunk/src/couchdb/couch_os_process.erl Sat Jan 24 11:39:21 2009
@@ -151,7 +151,7 @@
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}.