Dont try to allocate and send packets if the transport is down
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 30 Jun 2009 02:03:12 +0000 (12:03 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 27 Jul 2009 03:06:47 +0000 (13:06 +1000)
server/ctdb_control.c

index 72e60c526b9b662e298f0b233c9a6b95aa2b487a..f9bd42405ee0848085f8bee840823b010c0fd007 100644 (file)
@@ -590,6 +590,11 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
        struct ctdb_control_state *state;
        size_t len;
 
+       if (ctdb->methods == NULL) {
+               DEBUG(DEBUG_ERR,(__location__ " Failed to send control. Transport is DOWN\n"));
+               return -1;
+       }
+
        if (((destnode == CTDB_BROADCAST_VNNMAP) || 
             (destnode == CTDB_BROADCAST_ALL) ||
             (destnode == CTDB_BROADCAST_CONNECTED)) &&