ctdb-daemon: Exit if eventd goes away
authorMartin Schwenke <martin@meltin.net>
Thu, 11 Oct 2018 00:26:06 +0000 (11:26 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 22 Oct 2018 04:04:20 +0000 (06:04 +0200)
ctdbd enters a broken state if eventd goes away.  A clean shutdown is
not possible because that involves running events.  Restarting eventd
is possible but this might mask a serious problem and it is possible
that eventd might keep on disappearing.  Just exit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13659

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/eventscript.c

index 31f267c5c8e81091622c5b347f685f7b4e6e960c..11a870631229685f54f039af21de39d6a0d5bee5 100644 (file)
@@ -324,13 +324,8 @@ static void eventd_dead_handler(struct tevent_context *ev,
                                struct tevent_fd *fde, uint16_t flags,
                                void *private_data)
 {
-       struct eventd_context *ectx = talloc_get_type_abort(
-               private_data, struct eventd_context);
-
-       DEBUG(DEBUG_ERR, ("Eventd went away\n"));
-
-       TALLOC_FREE(ectx->eventd_fde);
-       ectx->eventd_pid = -1;
+       D_ERR("Eventd went away - exiting\n");
+       exit(1);
 }
 
 void ctdb_stop_eventd(struct ctdb_context *ctdb)