]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: drop GIL in get_config 26612/head
authorJohn Spray <john.spray@redhat.com>
Wed, 14 Nov 2018 11:19:14 +0000 (06:19 -0500)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 28 Feb 2019 22:37:51 +0000 (08:37 +1000)
Fixes: https://tracker.ceph.com/issues/35985
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit d590a5391876eda23ef286af5800e5bdbb2b4b97)

Conflicts:
        src/mgr/ActivePyModules.cc

src/mgr/ActivePyModules.cc
src/mgr/BaseMgrModule.cc

index 6e198d2d44fd83bcc55db26327b599b350d90855..b00cd8ffe4c6d681fb231635e89b1be017e5208a 100644 (file)
@@ -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;
 
index 764842251a7fcf6c7d6e66a991587d39e3b950a8..8b931091c7df9b990bed381075c8a17baa0ace17 100644 (file)
@@ -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());