From: John Spray Date: Wed, 14 Nov 2018 11:19:14 +0000 (-0500) Subject: mgr: drop GIL in get_config X-Git-Tag: v13.2.6~109^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26612%2Fhead;p=ceph.git mgr: drop GIL in get_config Fixes: https://tracker.ceph.com/issues/35985 Signed-off-by: John Spray (cherry picked from commit d590a5391876eda23ef286af5800e5bdbb2b4b97) Conflicts: src/mgr/ActivePyModules.cc --- diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 6e198d2d44fd..b00cd8ffe4c6 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -462,10 +462,6 @@ bool ActivePyModules::get_store(const std::string &module_name, bool ActivePyModules::get_config(const std::string &module_name, const std::string &key, std::string *val) const { - PyThreadState *tstate = PyEval_SaveThread(); - Mutex::Locker 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 764842251a7f..8b931091c7df 100644 --- a/src/mgr/BaseMgrModule.cc +++ b/src/mgr/BaseMgrModule.cc @@ -356,9 +356,13 @@ ceph_config_get(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) << "ceph_config_get " << what << " found: " << value.c_str() << dendl; return PyString_FromString(value.c_str());