From ca7e48c62e6a18c5a627d5e71ed8016e1e41b9a1 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 28 Aug 2017 10:08:12 -0400 Subject: [PATCH] mgr: fix crash in MonCommandCompletion Fixes: http://tracker.ceph.com/issues/21157 Signed-off-by: John Spray (cherry picked from commit 5fa61b2ed078a3cf333a3111d4f43584ce27ba9d) --- src/mgr/PyState.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.3