]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bugfix: should call md_config_t::remove_observer on shutdown 6125/head
authorRuifeng Yang <yangruifeng.09209@h3c.com>
Wed, 30 Sep 2015 08:30:41 +0000 (16:30 +0800)
committerRuifeng Yang <yangruifeng.09209@h3c.com>
Wed, 30 Sep 2015 08:30:49 +0000 (16:30 +0800)
Signed-off-by: Ruifeng Yang <yangruifeng.09209@h3c.com>
src/mds/MDSDaemon.cc
src/mon/Monitor.cc
src/osdc/Objecter.cc

index 8fb0a76a36a1f033bb7dd209c810e44d69abffc3..cf54e8257b2c7c8279ba0ff30b576b43aba35aac 100644 (file)
@@ -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
index b49578d3906d4a89b12f87835d42d6b26f128393..8dadaa0386873f11cea3b6c9e6d72ca09a9032df 100644 (file)
@@ -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");
index dc6f130adb067af09dc766b31815651a73830e3d..6a8beb8c5b007a7712bb1b5d042995aa95226bde 100644 (file)
@@ -314,6 +314,8 @@ void Objecter::shutdown()
 
   initialized.set(0);
 
+  cct->_conf->remove_observer(this);
+
   map<int,OSDSession*>::iterator p;
   while (!osd_sessions.empty()) {
     p = osd_sessions.begin();