From: Kefu Chai Date: Wed, 22 Mar 2017 06:10:23 +0000 (+0800) Subject: mgr: shutdown py_modules in Mgr::shutdown() X-Git-Tag: v12.0.2~264^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14078%2Fhead;p=ceph.git mgr: shutdown py_modules in Mgr::shutdown() Fixes: http://tracker.ceph.com/issues/19258 Signed-off-by: Kefu Chai --- diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index facfc2ea646..6207cd88db2 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -341,6 +341,9 @@ void Mgr::shutdown() // First stop the server so that we're not taking any more incoming requests server.shutdown(); + // after the messenger is stopped, signal modules to shutdown via finisher + py_modules.shutdown(); + // Then stop the finisher to ensure its enqueued contexts aren't going // to touch references to the things we're about to tear down finisher.wait_for_empty(); diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index 72eda5e58cd..7f2a8f6ca02 100644 --- a/src/mgr/PyModules.cc +++ b/src/mgr/PyModules.cc @@ -460,6 +460,7 @@ void PyModules::shutdown() } modules.clear(); + PyGILState_Ensure(); Py_Finalize(); }