From: Sage Weil Date: Fri, 21 Feb 2020 14:59:50 +0000 (-0600) Subject: mgr/BaseMgrModule: drop GIL for is_authorized check X-Git-Tag: v15.1.1~317^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F33464%2Fhead;p=ceph.git 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 --- 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; }