From: Sage Weil Date: Thu, 23 Feb 2012 04:49:04 +0000 (-0800) Subject: mon: unlock mon before msgr shutdown X-Git-Tag: v0.43~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=62a113aaa762a4c5def2880676e8ce10ce76baa2;p=ceph.git mon: unlock mon before msgr shutdown 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 5b3158456bb4..3554798112f9 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -220,9 +220,7 @@ void Monitor::handle_signal(int signum) { assert(signum == SIGINT || signum == SIGTERM); derr << "*** Got Signal " << sys_siglist[signum] << " ***" << dendl; - lock.Lock(); shutdown(); - lock.Unlock(); } void Monitor::init() @@ -342,7 +340,8 @@ void Monitor::update_logger() void Monitor::shutdown() { dout(1) << "shutdown" << dendl; - + lock.Lock(); + state = STATE_SHUTDOWN; if (admin_hook) { @@ -373,8 +372,10 @@ void Monitor::shutdown() timer.shutdown(); - // die. - messenger->shutdown(); + // unlock before msgr shutdown... + lock.Unlock(); + + messenger->shutdown(); // last thing! ceph_mon.cc will delete mon. } void Monitor::bootstrap()