We use eventloop nesting in a couple of places, notably the sync
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 18 Aug 2010 00:11:59 +0000 (10:11 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 18 Aug 2010 00:11:59 +0000 (10:11 +1000)
parts of the recovery daemon.

Initialize all event contexts to allow nesting

client/ctdb_client.c
lib/tevent/tevent.h
server/ctdb_daemon.c
server/ctdb_logging.c
server/ctdbd.c
tools/ctdb.c

index 1d854d15c53b5d3b27ae461374ac151a512cce42..51830abf55d471f5a8c71fd803306aca0a87dae4 100644 (file)
@@ -3839,6 +3839,7 @@ int switch_from_server_to_client(struct ctdb_context *ctdb)
        /* get a new event context */
        talloc_free(ctdb->ev);
        ctdb->ev = event_context_init(ctdb);
+       tevent_loop_allow_nesting(ctdb->ev);
 
        close(ctdb->daemon.sd);
        ctdb->daemon.sd = -1;
index c2aead22913ef03737a87fd9bf1beec9fdd5b993..d3bf3666d5f12cb92ea41389354d837b942de2b3 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef __TEVENT_H__
 #define __TEVENT_H__
 
+#define TEVENT_DEPRECATED
+
 #include <stdint.h>
 #include <talloc.h>
 #include <sys/time.h>
index 517ad9ba12c36dfb5a0360e150b57f3746d6bbef..1d803058e9877d053960a860dc17f5ee2e466f40 100644 (file)
@@ -773,6 +773,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog)
        }
 
        ctdb->ev = event_context_init(NULL);
+       tevent_loop_allow_nesting(ctdb->ev);
 
        ctdb_set_child_logging(ctdb);
 
index 4680c32b076d0fc098323eaa206d5c99c027f705..ee4499ca1af1ced1caa3b5085f57d189a8735128 100644 (file)
@@ -118,6 +118,7 @@ int start_syslog_daemon(struct ctdb_context *ctdb)
 
        talloc_free(ctdb->ev);
        ctdb->ev = event_context_init(NULL);
+       tevent_loop_allow_nesting(ctdb->ev);
 
        syslog(LOG_ERR, "Starting SYSLOG daemon with pid:%d", (int)getpid());
 
index b0b075c4f31931de8f57028bd8fda5d08a9b9470..89b9af179bc4c78c3c4baf52b84e45040ed19a53 100644 (file)
@@ -178,6 +178,7 @@ int main(int argc, const char *argv[])
        fault_setup("ctdbd");
 
        ev = event_context_init(NULL);
+       tevent_loop_allow_nesting(ev);
 
        ctdb = ctdb_cmdline_init(ev);
 
index e915e0099ddc3b9dee0ab72bff9ecc28acc175b4..a65c525faba3e7fb222d1977d49e3e9fe5479a82 100644 (file)
@@ -4534,6 +4534,7 @@ int main(int argc, const char *argv[])
                DEBUG(DEBUG_ERR, ("Failed to initialize event system\n"));
                exit(1);
        }
+       tevent_loop_allow_nesting(ev);
 
        for (i=0;i<ARRAY_SIZE(ctdb_commands);i++) {
                if (strcmp(control, ctdb_commands[i].name) == 0) {