]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix py_module_registry shutdown
authorJohn Spray <john.spray@redhat.com>
Mon, 16 Oct 2017 10:33:48 +0000 (06:33 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:29 +0000 (23:03 +0000)
Was calling way too early, which did a
Py_Finalize before the modules had been
joined.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 0d5b1d70e616d7d1c2d6360375770f5c4754649d)

src/mgr/MgrStandby.cc

index 62eb294f95a61178f0703333e3c31241dd2fdd04..171add02f8761106d2e972d391ac9288705ca171 100644 (file)
@@ -193,7 +193,7 @@ void MgrStandby::tick()
   dout(10) << __func__ << dendl;
   send_beacon();
 
-  if (active_mgr) {
+  if (active_mgr && active_mgr->is_initialized()) {
     active_mgr->tick();
   }
 
@@ -219,8 +219,6 @@ void MgrStandby::shutdown()
 
   dout(4) << "Shutting down" << dendl;
 
-  py_module_registry.shutdown();
-
   // stop sending beacon first, i use monc to talk with monitors
   timer.shutdown();
   // client uses monc and objecter
@@ -231,6 +229,9 @@ void MgrStandby::shutdown()
   if (active_mgr) {
     active_mgr->shutdown();
   }
+
+  py_module_registry.shutdown();
+
   // objecter is used by monc and active_mgr
   objecter.shutdown();
   // client_messenger is used by all of them, so stop it in the end