Merge pull request #27280 from xiexingguo/wip-39039

mgr: more GIL fixes

Reviewed-by: Yan Jun <yan.jun8@zte.com.cn>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-04-03 18:53:55 +08:00 committed by GitHub
commit 42f777e67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -593,10 +593,7 @@ void ActivePyModules::set_store(const std::string &module_name,
Command set_cmd;
{
PyThreadState *tstate = PyEval_SaveThread();
std::lock_guard l(lock);
PyEval_RestoreThread(tstate);
if (val) {
store_cache[global_key] = *val;
} else {

View File

@ -443,7 +443,9 @@ ceph_set_module_option(BaseMgrModule *self, PyObject *args)
if (value) {
val = value;
}
PyThreadState *tstate = PyEval_SaveThread();
self->py_modules->set_config(module, key, val);
PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}
@ -481,7 +483,9 @@ ceph_store_set(BaseMgrModule *self, PyObject *args)
if (value) {
val = value;
}
PyThreadState *tstate = PyEval_SaveThread();
self->py_modules->set_store(self->this_module->get_name(), key, val);
PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}