]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix crash in MonCommandCompletion 17483/head
authorJohn Spray <john.spray@redhat.com>
Mon, 28 Aug 2017 14:08:12 +0000 (10:08 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 5 Sep 2017 09:53:39 +0000 (11:53 +0200)
Fixes: http://tracker.ceph.com/issues/21157
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 5fa61b2ed078a3cf333a3111d4f43584ce27ba9d)

src/mgr/PyState.cc

index f03929102e4753ccad1c864bbe7c5375748763f0..fb6b831de727aef0a9d443342728ac60de90dd1d 100644 (file)
@@ -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);