Skip to content

Never schedule stdin feeds or child kill timers on the global queue - #4

Merged
Will-Howard merged 1 commit into
mainfrom
fix/pipe-fd-deadlock
Jul 28, 2026
Merged

Never schedule stdin feeds or child kill timers on the global queue#4
Will-Howard merged 1 commit into
mainfrom
fix/pipe-fd-deadlock

Conversation

@Will-Howard

Copy link
Copy Markdown
Owner

DispatchQueue.global() is non-overcommit, so on a low-core machine the blocked callers themselves can starve it: the -C stdin feeder never runs, the command never sees EOF on stdin, and the caller waits on it forever.

Three such tests wedged the test suite, causing the deadlock bug flagged in #3. This PR fixes that by feeding stdin from a dedicated thread and running the timers on a private queue.

Fixes #3

DispatchQueue.global() is non-overcommit, so on a low-core machine the
blocked callers themselves can starve it: the -C stdin feeder never runs,
the command never sees EOF on stdin, and the caller waits on it forever.
Three such tests wedged the whole suite on the 3-vCPU CI runner for 6
hours. The kill timers rode the same pool, so a timeout could silently
never fire exactly when a child hung. Feed stdin from a dedicated thread
and run the timers on a private queue.

Fixes #3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Will-Howard
Will-Howard merged commit ea21647 into main Jul 28, 2026
1 check passed
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.

Fix deadlock in tests

1 participant