]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/BaseMgrModule: drop GIL for is_authorized check 33464/head
authorSage Weil <sage@redhat.com>
Fri, 21 Feb 2020 14:59:50 +0000 (08:59 -0600)
committerSage Weil <sage@redhat.com>
Fri, 21 Feb 2020 15:01:14 +0000 (09:01 -0600)
This is making a call all the way to the mon!  We need to drop the GIL.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/BaseMgrModule.cc

index f194dfe4f025811c746bca5121c5a379a705324e..e59c8e46d6c62dc569c465ca7489f7bee088ea0c 100644 (file)
@@ -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;
 }