From 2b8961c9730b14912f71161496ead834af40214b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 4 May 2017 16:50:08 +0800 Subject: [PATCH] mgr: do the shutdown in the right order Fixes: http://tracker.ceph.com/issues/19813 Signed-off-by: Kefu Chai --- src/mgr/MgrStandby.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index 99eb74db9378e..1bfcadd71b45b 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -175,13 +175,19 @@ void MgrStandby::shutdown() // Expect already to be locked as we're called from signal handler assert(lock.is_locked_by_me()); + // stop sending beacon first, i use monc to talk with monitors + timer.shutdown(); + // client uses monc and objecter + client.shutdown(); + // stop monc, so mon won't be able to instruct me to shutdown/activate after + // the active_mgr is stopped + monc.shutdown(); if (active_mgr) { active_mgr->shutdown(); } - client.shutdown(); + // objecter is used by monc and active_mgr objecter.shutdown(); - timer.shutdown(); - monc.shutdown(); + // client_messenger is used by all of them, so stop it in the end client_messenger->shutdown(); } -- 2.39.5