fix: http://tracker.ceph.com/issues/35985
patch https://github.com/ceph/ceph/pull/26613 addressed a race in ActivePyModules.cc, whilst this patch addresses the race in BaseMgrStandbyModule.cc.
Partial manual backport of
6185bd66a9e9b23f1d1982b0bc12d672c33c6fcd
Signed-off-by: wumingqiao <wumingqiao@beyondcent.com>
}
std::string value;
+ PyThreadState *tstate = PyEval_SaveThread(); // drop GIL
bool found = self->this_module->get_config(what, &value);
+ PyEval_RestoreThread(tstate); // re-take GIL
if (found) {
dout(10) << "ceph_config_get " << what << " found: " << value.c_str() << dendl;
return PyString_FromString(value.c_str());
bool StandbyPyModule::get_config(const std::string &key,
std::string *value) const
{
- PyThreadState *tstate = PyEval_SaveThread();
- PyEval_RestoreThread(tstate);
-
const std::string global_key = PyModuleRegistry::config_prefix
+ module_name + "/" + key;