You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/01 11:10:27 UTC

[31/35] git commit: Kill couch_db_event with supervisor functions

Kill couch_db_event with supervisor functions

Apparently gen_event ignores unknown kill messages so we'll force a
clean shutdown with superisor functions.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/commit/de231715
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/tree/de231715
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/diff/de231715

Branch: refs/heads/windsor-merge
Commit: de231715e270d685389e0e8e79eed2715bc1e61c
Parents: 022af54
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sat Jun 15 13:13:05 2013 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 30 17:49:11 2014 +0100

----------------------------------------------------------------------
 src/couch_event_server.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/blob/de231715/src/couch_event_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_event_server.erl b/src/couch_event_server.erl
index 1bf8f1e..bd291aa 100644
--- a/src/couch_event_server.erl
+++ b/src/couch_event_server.erl
@@ -126,7 +126,10 @@ watchdog() ->
     Handlers = gen_event:which_handlers(couch_db_update),
     case length(Handlers) > 0 of
         true ->
-            exit(whereis(couch_db_update), force_upgrade);
+            supervisor:terminate_child(
+                    couch_primary_services, couch_db_update_event),
+            supervisor:restart_child(
+                    couch_primary_services, couch_db_update_event);
         false ->
             ok
     end,