Skip to content

Commit 4d433eb

Browse files
committed
stop zmq garbage collection to avoid threadsafety issues
when cleaning up all zmq resources
1 parent 63e4205 commit 4d433eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jupyter_client/tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def assert_no_zmq():
5050
avoids reference leaks across tests,
5151
which can lead to FD exhaustion
5252
"""
53+
# zmq garbage collection uses a zmq socket in a thread
54+
# we don't want to delete these from the main thread!
55+
from zmq.utils import garbage
56+
57+
garbage.gc.stop()
5358
sockets = [
5459
obj
5560
for obj in gc.get_referrers(zmq.Socket)

0 commit comments

Comments
 (0)