From: John Spray Date: Mon, 28 Aug 2017 14:08:12 +0000 (-0400) Subject: mgr: fix crash in MonCommandCompletion X-Git-Tag: v12.2.1~51^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca7e48c62e6a18c5a627d5e71ed8016e1e41b9a1;p=ceph.git mgr: fix crash in MonCommandCompletion Fixes: http://tracker.ceph.com/issues/21157 Signed-off-by: John Spray (cherry picked from commit 5fa61b2ed078a3cf333a3111d4f43584ce27ba9d) --- diff --git a/src/mgr/PyState.cc b/src/mgr/PyState.cc index f03929102e47..fb6b831de727 100644 --- a/src/mgr/PyState.cc +++ b/src/mgr/PyState.cc @@ -58,7 +58,9 @@ public: dout(10) << "MonCommandCompletion::finish()" << dendl; { // Scoped so the Gil is released before calling notify_all() - Gil gil(pThreadState); + // Create new thread state because this is called via the MonClient + // Finisher, not the PyModules finisher. + Gil gil(pThreadState, true); auto set_fn = PyObject_GetAttrString(python_completion, "complete"); assert(set_fn != nullptr);