From d590a5391876eda23ef286af5800e5bdbb2b4b97 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 14 Nov 2018 06:19:14 -0500 Subject: [PATCH] mgr: drop GIL in get_config Signed-off-by: John Spray --- src/mgr/ActivePyModules.cc | 4 ---- src/mgr/BaseMgrModule.cc | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 6f75a7b6586..8e35353f778 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -503,10 +503,6 @@ PyObject *ActivePyModules::dispatch_remote( bool ActivePyModules::get_config(const std::string &module_name, const std::string &key, std::string *val) const { - PyThreadState *tstate = PyEval_SaveThread(); - std::lock_guard l(lock); - PyEval_RestoreThread(tstate); - const std::string global_key = PyModule::config_prefix + module_name + "/" + key; diff --git a/src/mgr/BaseMgrModule.cc b/src/mgr/BaseMgrModule.cc index 20a4e9f434f..c60b9d92285 100644 --- a/src/mgr/BaseMgrModule.cc +++ b/src/mgr/BaseMgrModule.cc @@ -394,9 +394,13 @@ ceph_get_module_option(BaseMgrModule *self, PyObject *args) return nullptr; } + PyThreadState *tstate = PyEval_SaveThread(); std::string value; bool found = self->py_modules->get_config(self->this_module->get_name(), what, &value); + + PyEval_RestoreThread(tstate); + if (found) { dout(10) << __func__ << " " << what << " found: " << value.c_str() << dendl; return PyString_FromString(value.c_str()); -- 2.47.3