]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/BaseMgrStandbyModule: drop GIL in ceph_get_module_option() 30770/head 30771/head 30773/head
authorKefu Chai <kchai@redhat.com>
Fri, 27 Sep 2019 18:25:44 +0000 (02:25 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 7 Oct 2019 19:11:26 +0000 (21:11 +0200)
always drop GIL when performing block ops

Fixes: https://tracker.ceph.com/issues/42087
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit dea578758239ea0442f95f10dc2440f45a2ce547)

src/mgr/BaseMgrStandbyModule.cc

index b445f8dce3a19185102807098b73356b25ec8fab..f3fbff667cf6db9e6c913badf003617c53c7c21a 100644 (file)
@@ -69,6 +69,7 @@ ceph_get_module_option(BaseMgrStandbyModule *self, PyObject *args)
     derr << "Invalid args!" << dendl;
     return nullptr;
   }
+  PyThreadState *tstate = PyEval_SaveThread();
   std::string final_key;
   std::string value;
   bool found = false;
@@ -80,6 +81,7 @@ ceph_get_module_option(BaseMgrStandbyModule *self, PyObject *args)
     final_key = what;
     found = self->this_module->get_config(final_key, &value);
   }
+  PyEval_RestoreThread(tstate);
   if (found) {
     dout(10) << __func__ << " " << final_key << " found: " << value
             << dendl;