From: John Spray Date: Tue, 17 Oct 2017 22:16:22 +0000 (-0400) Subject: mgr: drop GIL around set_uri, set_health_checks X-Git-Tag: v13.0.1~332^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=27ee148e040ebaf512f8e11f814b3a7c8cf21f8b;p=ceph.git mgr: drop GIL around set_uri, set_health_checks These didn't need to keep the GIL to go and do their pure C++ parts, and by keeping it they could deadlock while trying to take ActiveMgrModules::lock. Signed-off-by: John Spray --- diff --git a/src/mgr/BaseMgrModule.cc b/src/mgr/BaseMgrModule.cc index 95e75492c932..74d1a948f306 100644 --- a/src/mgr/BaseMgrModule.cc +++ b/src/mgr/BaseMgrModule.cc @@ -305,8 +305,10 @@ ceph_set_health_checks(BaseMgrModule *self, PyObject *args) jf.flush(*_dout); *_dout << dendl; + PyThreadState *tstate = PyEval_SaveThread(); self->py_modules->set_health_checks(self->this_module->get_name(), std::move(out_checks)); + PyEval_RestoreThread(tstate); Py_RETURN_NONE; } @@ -493,7 +495,9 @@ ceph_set_uri(BaseMgrModule *self, PyObject *args) // We call down into PyModules even though we have a MgrPyModule // reference here, because MgrPyModule's fields are protected // by PyModules' lock. + PyThreadState *tstate = PyEval_SaveThread(); self->py_modules->set_uri(self->this_module->get_name(), svc_str); + PyEval_RestoreThread(tstate); Py_RETURN_NONE; }