couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [32/35] git commit: Rearrange and lengthen the watchdog delay
Date Fri, 01 Aug 2014 09:10:28 GMT
Rearrange and lengthen the watchdog delay

I did not completely comprehend that code upgrades are not atomic for
all code. This watchdog ended up causing a node reboot into an unusable
state because it killed couch_db_update_notifier handlers before the new
code was installed for each app.

This lead to mem3 quickly cycling trying to use couch_db_update_notifier
which eventually took down the mem3 app which took down the node. Then
the node would reboot into 1202 after databases had upgraded their
headers which prevented the node from booting correctly.

By extending the timeout to five minutes and placing it before the first
call to terminating couch_db_update I hope to give the release enough
time to complete before telling each handler to upgrade.


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/707997e3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/tree/707997e3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/diff/707997e3

Branch: refs/heads/windsor-merge
Commit: 707997e37db11aa8194b00c0a432e49c7071b1f2
Parents: de23171
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Tue Jun 18 12:14:17 2013 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Wed Jul 30 17:49:19 2014 +0100

----------------------------------------------------------------------
 src/couch_event_server.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/blob/707997e3/src/couch_event_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_event_server.erl b/src/couch_event_server.erl
index bd291aa..1c7bcf4 100644
--- a/src/couch_event_server.erl
+++ b/src/couch_event_server.erl
@@ -123,6 +123,7 @@ code_change(_OldVsn, St, _Extra) ->
 
 
 watchdog() ->
+    timer:sleep(300000),
     Handlers = gen_event:which_handlers(couch_db_update),
     case length(Handlers) > 0 of
         true ->
@@ -133,7 +134,6 @@ watchdog() ->
         false ->
             ok
     end,
-    timer:sleep(5000),
     ?MODULE:watchdog().
 
 


Mime
View raw message