From: Kefu Chai Date: Fri, 27 Sep 2019 18:25:44 +0000 (+0800) Subject: mgr/BaseMgrStandbyModule: drop GIL in ceph_get_module_option() X-Git-Tag: v15.1.0~1382^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dea578758239ea0442f95f10dc2440f45a2ce547;p=ceph.git mgr/BaseMgrStandbyModule: drop GIL in ceph_get_module_option() always drop GIL when performing block ops Fixes: https://tracker.ceph.com/issues/42087 Signed-off-by: Kefu Chai --- diff --git a/src/mgr/BaseMgrStandbyModule.cc b/src/mgr/BaseMgrStandbyModule.cc index b445f8dce3a1..f3fbff667cf6 100644 --- a/src/mgr/BaseMgrStandbyModule.cc +++ b/src/mgr/BaseMgrStandbyModule.cc @@ -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;