move the checking of the CONNECT_WAIT flag into the start method for tcp
authorRonnie sahlberg <ronniesahlberg@gmail.com>
Tue, 10 Apr 2007 02:39:25 +0000 (12:39 +1000)
committerRonnie sahlberg <ronniesahlberg@gmail.com>
Tue, 10 Apr 2007 02:39:25 +0000 (12:39 +1000)
common/ctdb.c
common/ctdb_daemon.c
tcp/tcp_init.c

index 0add6f1d82ccc9b96b3d743ecfb6cc8976d506d6..d8b4859232dddadad2e0a4469309f5de2a1daaac 100644 (file)
@@ -346,13 +346,5 @@ int ctdb_start(struct ctdb_context *ctdb)
                return ctdbd_start(ctdb);
        }
 
-       res = ctdb->methods->start(ctdb);
-
-       if (ctdb->flags&CTDB_FLAG_CONNECT_WAIT) {
-               /* wait until all nodes are connected (should not be needed
-                  outide of test code) */
-               ctdb_connect_wait(ctdb);
-       }
-
-       return res;
+       return ctdb->methods->start(ctdb);
 }
index 71fc8f47f3fe23f251fc9c6fe047f61ebab38944..dc1e1477163100be74ba143fed6aec176e7c4b11 100644 (file)
@@ -35,12 +35,6 @@ static void ctdb_main_loop(struct ctdb_context *ctdb)
 {
        ctdb->methods->start(ctdb);
 
-       if (ctdb->flags&CTDB_FLAG_CONNECT_WAIT) {
-               /* wait until all nodes are connected (should not be needed
-                  outide of test code) */
-               ctdb_connect_wait(ctdb);
-       }
-
        /* go into a wait loop to allow other nodes to complete */
        event_loop_wait(ctdb->ev);
 
index 0058e7ad856e9ff91d1ef75398f6acb7ef8d03d9..0ab12790d49835453cd391ee97555fb8c057b4a0 100644 (file)
@@ -46,6 +46,12 @@ int ctdb_tcp_start(struct ctdb_context *ctdb)
                                ctdb_tcp_node_connect, node);
        }
 
+       if (ctdb->flags&CTDB_FLAG_CONNECT_WAIT) {
+               /* wait until all nodes are connected (should not be needed
+                  outide of test code) */
+               ctdb_connect_wait(ctdb);
+       }
+
        return 0;
 }