From dea578758239ea0442f95f10dc2440f45a2ce547 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 28 Sep 2019 02:25:44 +0800 Subject: [PATCH] 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 --- src/mgr/BaseMgrStandbyModule.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mgr/BaseMgrStandbyModule.cc b/src/mgr/BaseMgrStandbyModule.cc index b445f8dce3a..f3fbff667cf 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; -- 2.39.5