]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/cephfs: drop gil during cephfs callouts
authorPatrick Donnelly <pdonnell@redhat.com>
Sun, 2 Jul 2023 16:05:08 +0000 (12:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 5 Jul 2023 17:31:49 +0000 (13:31 -0400)
This has disastorous consequences including the possibility of deadlock.
In the best case, you have the rmdir holding the GIL until the MDS
responds!

Fixes: https://tracker.ceph.com/issues/61869
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 5d249a4c978198f1e8974affac0297b71bebada5)

src/pybind/cephfs/cephfs.pyx

index 251302fb262ccbb3dcb6fff2a3f300f6084fa7f1..fca3846de64a6a79fec4e1c62965f9cc24c08b84 100644 (file)
@@ -1087,7 +1087,8 @@ cdef class LibCephFS(object):
         cdef:
             char* _path = path
             char* _name = name
-        ret = ceph_rmsnap(self.cluster, _path, _name)
+        with nogil:
+            ret = ceph_rmsnap(self.cluster, _path, _name)
         if ret < 0:
             raise make_ex(ret, "rmsnap error")
         return 0
@@ -1106,7 +1107,8 @@ cdef class LibCephFS(object):
         cdef:
             char* _path = path
             snap_info info
-        ret = ceph_get_snap_info(self.cluster, _path, &info)
+        with nogil:
+            ret = ceph_get_snap_info(self.cluster, _path, &info)
         if ret < 0:
             raise make_ex(ret, "snap_info error")
         md = {}
@@ -1271,7 +1273,8 @@ cdef class LibCephFS(object):
         self.require_state("mounted")
         path = cstr(path, 'path')
         cdef char* _path = path
-        ret = ceph_rmdir(self.cluster, _path)
+        with nogil:
+            ret = ceph_rmdir(self.cluster, _path)
         if ret < 0:
             raise make_ex(ret, "error in rmdir {}".format(path.decode('utf-8')))