From b1307e074b5fb708420686bf814bd4a7aa76f6d8 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 16 Oct 2017 06:33:48 -0400 Subject: [PATCH] mgr: fix py_module_registry shutdown Was calling way too early, which did a Py_Finalize before the modules had been joined. Signed-off-by: John Spray (cherry picked from commit 0d5b1d70e616d7d1c2d6360375770f5c4754649d) --- src/mgr/MgrStandby.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index 62eb294f95a61..171add02f8761 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -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 -- 2.39.5