Repository navigation
fix(coding/execution): prefer the sink error over the operation deadline - #38
Merged
Merged
Conversation
rsbin1178
force-pushed
the
fix/execution-drain-before-close
branch
from
October 8, 2026 14:56
d780630 to
a1de623
Compare
rsbin1178
changed the base branch from
fix/execution-drain-before-close
to
main
October 8, 2026 15:04
rsbin1178
marked this pull request as ready for review
October 8, 2026 15:04
The runner took whichever of {process exit, output trigger, context done} arrived
first and kept only that error, so a caller whose sink failed could be told
"context deadline exceeded" instead: the fixture's one-second operation deadline can
expire before the dispatcher goroutine reports the failure, which is what the macOS
sandbox runner hit.
The dispatcher now records the sink's failure beside reporting it on the trigger, and
the run prefers that record: the sink error leads the returned error and any context
error that also happened is joined behind it, so nothing is dropped. The error
classification still sees the preferred error and the status stays canceled.
Measured: a test cancels the caller's context while its sink is running and lets the
sink fail afterwards. Without the preference applied it fails three runs out of three
with "Target error should be in err chain", and with it the caller sees both the sink
failure and the cancellation, twenty -race repetitions.
rsbin1178
force-pushed
the
fix/execution-sink-error-precedence
branch
from
October 8, 2026 15:04
b5ed125 to
4d84234
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.
The runner took whichever of {process exit, output trigger, context done} arrived
first and kept only that error, so a caller whose sink failed could be told
"context deadline exceeded" instead: the fixture's one-second operation deadline can
expire before the dispatcher goroutine reports the failure, which is what the macOS
sandbox runner hit.
The dispatcher now records the sink's failure beside reporting it on the trigger, and
the run prefers that record: the sink error leads the returned error and any context
error that also happened is joined behind it, so nothing is dropped. The error
classification still sees the preferred error and the status stays canceled.
Measured: a test cancels the caller's context while its sink is running and lets the
sink fail afterwards. Without the preference applied it fails three runs out of three
with "Target error should be in err chain", and with it the caller sees both the sink
failure and the cancellation, twenty -race repetitions.
Evidence
The new runner test cancels the caller context while the sink runs and then fails the sink. With the preference line removed it fails three runs out of three ("Target error should be in err chain"); with it,
errors.Isfinds both the sink failure andcontext.Canceled, and the status is canceled. A unit test pins the rule itself: a sink failure leads, a context error is joined behind it, and an already-present failure is not duplicated.TERM=xterm-256color go test ./...(89 packages),go test -race -count=20 ./internal/coding/execution/andgolangci-lint run --new-from-rev=HEAD~ ./...(0 issues) are clean.Based on #37, which must merge first.