]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: drop GIL in get_config
authorJohn Spray <john.spray@redhat.com>
Wed, 14 Nov 2018 11:19:14 +0000 (06:19 -0500)
committerSage Weil <sage@redhat.com>
Tue, 18 Dec 2018 19:30:54 +0000 (13:30 -0600)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/ActivePyModules.cc
src/mgr/BaseMgrModule.cc

index 6f75a7b6586b3204188627dd3032db46971e246e..8e35353f7782006ecef503f2a57c7acb1a231e0b 100644 (file)
@@ -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;
 
index 20a4e9f434fe77d156dc714774644cd07d940a9e..c60b9d9228566744da7f84135b59b889289d4f85 100644 (file)
@@ -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());