ctdb->methods becomes NULL when we shutdown the transport.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 11 May 2008 04:28:33 +0000 (14:28 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 11 May 2008 04:28:33 +0000 (14:28 +1000)
commitc4c2c53918da6fb566d6e9cbd6b02e61ae2921e7
treecc3d9883b3ee7649a4512b784835140b15f8c6c2
parentd36f6a5ceb57364449b246a4e6664a7da6cb0040
ctdb->methods becomes NULL when we shutdown the transport.

If we shutdown the transport   and CTDB later decides to send a command out
for queueing, the call to ctdb->methods->allocate_pkt() will SEGV.

This could trigger for example when we are in the process of shuttind down CTDBD and have already shutdown the transport but we are still waiting for the
"shutdown" eventscripts to finish.
If the event scripts now take much much longer to execute for some reason, this
race condition becomes much more probable.

Decorate all dereferencing of ctdb->methods->    with a check that ctdb->menthods is non-NULL
server/ctdb_control.c
server/ctdb_daemon.c
server/ctdb_recover.c
server/ctdb_recoverd.c
server/ctdb_server.c