ctdb-daemon: Do not disable monitoring when running eventscripts
authorMartin Schwenke <martin@meltin.net>
Tue, 4 Mar 2014 04:06:11 +0000 (15:06 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 23 Mar 2014 03:20:14 +0000 (04:20 +0100)
This is racy and cbffbb7c2f406fc1d8ebad3c531cc2757232690e makes it
unnecessary.

The eventscript code still knows that monitor events are special
compared to other events.  However, the general concept of monitoring
is no longer tangled up with running scripts.

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

index ed20124bb0a7e72ce2c23c915c23ff4722b00812..bf95b2114b3a1c7d24fcf9be271ffe5239099065 100644 (file)
@@ -901,8 +901,6 @@ static void run_eventscripts_callback(struct ctdb_context *ctdb, int status,
        struct eventscript_callback_state *state = 
                talloc_get_type(private_data, struct eventscript_callback_state);
 
-       ctdb_enable_monitoring(ctdb);
-
        if (status != 0) {
                DEBUG(DEBUG_ERR,(__location__ " Failed to run eventscripts\n"));
        }
@@ -966,14 +964,11 @@ int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
 
        DEBUG(DEBUG_NOTICE,("Running eventscripts with arguments %s\n", indata.dptr));
 
-       ctdb_disable_monitoring(ctdb);
-
        ret = ctdb_event_script_callback(ctdb, 
                         state, run_eventscripts_callback, state,
                         call, "%s", options);
 
        if (ret != 0) {
-               ctdb_enable_monitoring(ctdb);
                DEBUG(DEBUG_ERR,(__location__ " Failed to run eventscripts with arguments %s\n", indata.dptr));
                talloc_free(state);
                return -1;