From 0ce749165a5dbd367ac8d36b642442cd16f0923c Mon Sep 17 00:00:00 2001 From: Ruifeng Yang Date: Wed, 30 Sep 2015 16:30:41 +0800 Subject: [PATCH] bugfix: should call md_config_t::remove_observer on shutdown Signed-off-by: Ruifeng Yang --- src/mds/MDSDaemon.cc | 5 +++++ src/mon/Monitor.cc | 2 ++ src/osdc/Objecter.cc | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 8fb0a76a36a1f..cf54e8257b2c7 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -988,6 +988,11 @@ void MDSDaemon::suicide() tick_event = 0; } + //because add_observer is called after set_up_admin_socket + //so we can use asok_hook to avoid assert in the remove_observer + if (asok_hook != NULL) + g_conf->remove_observer(this); + clean_up_admin_socket(); // Inform MDS we are going away, then shut down beacon diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index b49578d3906d4..8dadaa0386873 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -853,6 +853,8 @@ void Monitor::shutdown() state = STATE_SHUTDOWN; + g_conf->remove_observer(this); + if (admin_hook) { AdminSocket* admin_socket = cct->get_admin_socket(); admin_socket->unregister_command("mon_status"); diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index dc6f130adb067..6a8beb8c5b007 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -314,6 +314,8 @@ void Objecter::shutdown() initialized.set(0); + cct->_conf->remove_observer(this); + map::iterator p; while (!osd_sessions.empty()) { p = osd_sessions.begin(); -- 2.39.5