ASH-215: runner.Run context + timeout (hung git can't wedge the daemon)#15
Merged
Conversation
runner.Run used exec.Command with no deadline. The git verb's shellout
path (status/diff/log/show) called it that way, so a git subprocess
that hung — stalled network filesystem, credential prompt, wedged
hook — pinned the daemon handler goroutine indefinitely, and with
[daemon].max_concurrent_handlers set, enough hung calls wedge the
daemon. Request cancellation also could not reach the subprocess.
- runner: switch to exec.CommandContext. The context is derived from
opts.Tracer (so a cancelled request kills the subprocess), and a new
opts.Timeout adds a hard ceiling — a timed-out run returns a
"<prog>_timeout" proto.Error rather than being misreported as a
normal failure.
- git: all six shellout call sites pass a 30s shelloutTimeout. Read-side
git ops finish well under a second on a healthy repo; 30s only ever
fires on a genuine hang.
- runner_test: add a timeout regression test.
- Regenerate docs/vocab/inventory.{md,json} — the new "<prog>_timeout"
error code resolves to git_timeout / go_timeout in the inventory.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cstaszak
force-pushed
the
cstaszak/ash-215-runner-timeout
branch
from
May 22, 2026 00:55
87789ee to
ae3ef4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
runner.Runusedexec.Commandwith no deadline. The git verb's shellout path (status/diff/log/show) called it that way, so a hunggitsubprocess — stalled network FS, credential prompt, wedged hook — pinned a daemon handler goroutine indefinitely. With[daemon].max_concurrent_handlersset, enough hung calls wedge the whole daemon. Request cancellation also couldn't reach the subprocess.exec.CommandContext. Context derived fromopts.Tracer(a cancelled request now kills the subprocess), and a newopts.Timeoutadds a hard ceiling — a timed-out run returns a<prog>_timeoutproto.Errorinstead of being misreported as a normal failure. Backwards-compatible: callers that set neither field getcontext.Background()and behave exactly as before.shelloutTimeout. Read-side git ops finish well under a second on a healthy repo; 30s only fires on a genuine hang.Found in the post-public-release code review.
🤖 Generated with Claude Code