Skip to content

Reset blocked operations after fork - #463

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
reset-blocked-after-fork
Jul 29, 2026
Merged

Reset blocked operations after fork#463
samuel-williams-shopify merged 1 commit into
mainfrom
reset-blocked-after-fork

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Async scheduler state is copied into a forked child, but the fibers represented by @blocked are not. Reset the inherited counter before detaching the child scheduler so Scheduler#close does not raise Closing scheduler with blocked operations!.

This was exposed by socketry/async-container#76 when moving Process.fork from a separate native thread to a clean fiber.

Adds a regression test that forks while another fiber is blocked in Thread::Queue#pop.

@samuel-williams-shopify
samuel-williams-shopify merged commit 66656f4 into main Jul 29, 2026
77 of 81 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the reset-blocked-after-fork branch July 29, 2026 09:05
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