Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fsspec/asyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ def get_loop():
return loop[0]


def reset_after_fork():
global lock
loop[0] = None
iothread[0] = None
lock = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this works? Why is only the lock declared as global. Furthermore, there is no lock in this file, only _lock and get_lock. This got changed in ffe57d6. Furthermore, this function is basically identical to reset_lock, so why not use that function?



if hasattr(os, "register_at_fork"):
# should be posix; this will do nothing for spawn or forkserver subprocesses
os.register_at_fork(after_in_child=reset_after_fork)


if TYPE_CHECKING:
import resource

Expand Down
Loading