Skip to content

Commit 5d249a4

Browse files
committed
pybind/cephfs: drop gil during cephfs callouts
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 <[email protected]>
1 parent a0082f6 commit 5d249a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pybind/cephfs/cephfs.pyx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,8 @@ cdef class LibCephFS(object):
11691169
cdef:
11701170
char* _path = path
11711171
char* _name = name
1172-
ret = ceph_rmsnap(self.cluster, _path, _name)
1172+
with nogil:
1173+
ret = ceph_rmsnap(self.cluster, _path, _name)
11731174
if ret < 0:
11741175
raise make_ex(ret, "rmsnap error")
11751176
return 0
@@ -1188,7 +1189,8 @@ cdef class LibCephFS(object):
11881189
cdef:
11891190
char* _path = path
11901191
snap_info info
1191-
ret = ceph_get_snap_info(self.cluster, _path, &info)
1192+
with nogil:
1193+
ret = ceph_get_snap_info(self.cluster, _path, &info)
11921194
if ret < 0:
11931195
raise make_ex(ret, "snap_info error")
11941196
md = {}
@@ -1353,7 +1355,8 @@ cdef class LibCephFS(object):
13531355
self.require_state("mounted")
13541356
path = cstr(path, 'path')
13551357
cdef char* _path = path
1356-
ret = ceph_rmdir(self.cluster, _path)
1358+
with nogil:
1359+
ret = ceph_rmdir(self.cluster, _path)
13571360
if ret < 0:
13581361
raise make_ex(ret, "error in rmdir {}".format(path.decode('utf-8')))
13591362

0 commit comments

Comments
 (0)