mirror of
https://github.com/ceph/ceph
synced 2024-12-17 08:57:28 +00:00
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 <sage.weil@dreamhost.com>
This commit is contained in:
parent
d1fe2f8fd7
commit
62a113aaa7
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user