From 84430e86026bb2ae8dcb4e260a81ca547e42a54c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 21 Feb 2020 08:59:50 -0600 Subject: [PATCH] mgr/BaseMgrModule: drop GIL for is_authorized check This is making a call all the way to the mon! We need to drop the GIL. Signed-off-by: Sage Weil --- src/mgr/BaseMgrModule.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mgr/BaseMgrModule.cc b/src/mgr/BaseMgrModule.cc index f194dfe4f025..e59c8e46d6c6 100644 --- a/src/mgr/BaseMgrModule.cc +++ b/src/mgr/BaseMgrModule.cc @@ -1055,10 +1055,13 @@ ceph_is_authorized(BaseMgrModule *self, PyObject *args) arguments[arg_key] = arg_value; } - if (self->this_module->is_authorized(arguments)) { + PyThreadState *tstate = PyEval_SaveThread(); + bool r = self->this_module->is_authorized(arguments); + PyEval_RestoreThread(tstate); + + if (r) { Py_RETURN_TRUE; } - Py_RETURN_FALSE; } -- 2.47.3