Skip to content

Bug/mp deadlock#42

Open
zherbz wants to merge 2 commits into
Dewberry:mainfrom
fema-ffrd:bug/mp_deadlock
Open

Bug/mp deadlock#42
zherbz wants to merge 2 commits into
Dewberry:mainfrom
fema-ffrd:bug/mp_deadlock

Conversation

@zherbz
Copy link
Copy Markdown
Contributor

@zherbz zherbz commented May 21, 2026

Stormhub works out of the box when Threads=True (ThreadPoolExecutor), but not when Threads=False (ProcessPoolExecutor), regardless of how you size your EC2,

Root cause: s3fs/fsspec (used for S3 AORC zarr access) starts a background thread running an asyncio event loop as part of its async filesystem implementation. When ProcessPoolExecutor creates workers using Linux's default fork start method, only the forking thread survives in each child process — but the asyncio background thread's internal locks are inherited in the locked state. When a worker then calls and tries to schedule async I/O, it blocks forever waiting for those locks.

The fix is to use spawn as the multiprocessing context, which creates fresh worker processes that don't inherit the parent's thread/lock state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant