ctdb-daemon: Make ctdb_event_script_args() terminate if no scripts
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Mar 2015 09:27:45 +0000 (20:27 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 10 May 2015 01:22:14 +0000 (03:22 +0200)
status.done is never set to true unless event_script_callback() is
invoked.  The short-circuit in ctdb_event_script_callback_v() means
that this doesn't happen.  CTDB can't work very well without 00.ctdb
(for tunable initialisation and the like) but it shouldn't get stuck.

So call the callback when there are no scripts in
event_script_callback().

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

index 4dd437924f3b4cf7fa5a6c548c7c885a5faef8d8..f976111f992c7115b0a868e70d9645d3fdafab0e 100644 (file)
@@ -794,6 +794,7 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
 
        /* Nothing to do? */
        if (state->scripts->num_scripts == 0) {
+               callback(ctdb, 0, private_data);
                talloc_free(state);
                return 0;
        }