We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1aaebf commit 6b85a47Copy full SHA for 6b85a47
fsspec/asyn.py
@@ -151,6 +151,18 @@ def get_loop():
151
return loop[0]
152
153
154
+def reset_after_fork():
155
+ global lock
156
+ loop[0] = None
157
+ iothread[0] = None
158
+ lock = None
159
+
160
161
+if hasattr(os, "register_at_fork"):
162
+ # should be posix; this will do nothing for spawn or forkserver subprocesses
163
+ os.register_at_fork(after_in_child=reset_after_fork)
164
165
166
if TYPE_CHECKING:
167
import resource
168
0 commit comments