From 27ee148e040ebaf512f8e11f814b3a7c8cf21f8b Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 17 Oct 2017 18:16:22 -0400 Subject: [PATCH] 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 --- src/mgr/BaseMgrModule.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mgr/BaseMgrModule.cc b/src/mgr/BaseMgrModule.cc index 95e75492c93..74d1a948f30 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; } -- 2.39.5