dont call ctdb_fatal() just because we are asked to restart a connection 1.0.64 obnox/1.0.64 origin/1.0.64
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 17 Dec 2008 01:01:40 +0000 (12:01 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 17 Dec 2008 01:01:40 +0000 (12:01 +1100)
to a remote node and ctdb->methods is NULL.

This can happen when we are in the middle of a normal shutdown of the
daemon and we have already shut down the transport layer (thus setting
ctdb->methods == NULL in the transport layer destructor)
band there is some unprocessed data related to a remote node.

This prevents an ugly race condition where ctdb might sometimes (rare)
cause a core dump during "ctdb shutdown".

server/ctdb_server.c

index b41101d205cdeb57e208fc6084a9951b15e62926..d9a32347ce70e1f7e9719e784878e44e193a45b1 100644 (file)
@@ -359,8 +359,8 @@ void ctdb_node_dead(struct ctdb_node *node)
        ctdb_daemon_cancel_controls(node->ctdb, node);
 
        if (node->ctdb->methods == NULL) {
-               DEBUG(DEBUG_ALERT,(__location__ " Can not restart transport. ctdb->methods==NULL\n"));
-               ctdb_fatal(node->ctdb, "can not restart transport.");
+               DEBUG(DEBUG_ERR,(__location__ " Can not restart transport while shutting down daemon.\n"));
+               return;
        }
 
        node->ctdb->methods->restart(node);