The ceph_mon.cc main() will delete mon when the msgr dispatch thread
completes. Make sure we unlock before we shut down the messenger, and
avoid touching this after messenger->shutdown().
Fixes: #2090
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
{
assert(signum == SIGINT || signum == SIGTERM);
derr << "*** Got Signal " << sys_siglist[signum] << " ***" << dendl;
- lock.Lock();
shutdown();
- lock.Unlock();
}
void Monitor::init()
void Monitor::shutdown()
{
dout(1) << "shutdown" << dendl;
-
+ lock.Lock();
+
state = STATE_SHUTDOWN;
if (admin_hook) {
timer.shutdown();
- // die.
- messenger->shutdown();
+ // unlock before msgr shutdown...
+ lock.Unlock();
+
+ messenger->shutdown(); // last thing! ceph_mon.cc will delete mon.
}
void Monitor::bootstrap()