Repository navigation
fix(cli): degrade a dead log transport to dropped output (issue #339) - #343
Merged
Merged
Conversation
On GitHub Actions windows-latest runners, raco rivet build intermittently fails with `error writing to stream port` (win_err=998) after the child MSBuild already exited 0 and produced the exe: the hosted log pipe dies under the CLI and the next printf from rivet raises, conflating a log transport failure with a build failure. Three occurrences observed in one day, each rerun green. Wrap the command dispatch in tolerant ports: a failed write (or close) on the ambient stdout/stderr is treated as a completed one and the bytes are dropped. The child's exit code stays the only success signal, and healthy transports pass output through byte-for-byte. Regression tests cover passthrough, thousands of writes into dead transports, and a raising close handler.
Owner
Author
|
Follow-up review fix added at |
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.
Closes #339.
Failure mode
On GitHub Actions
windows-latestrunners,raco rivet buildfor a WinUI 3 app intermittently fails witheven though the child MSBuild exited 0 and the executable was produced (the link steps and
0 Error(s)summary are right there in the log). Three occurrences in one day on the shuttle private repo; every immediate rerun was green.Root cause
The CLI runs tools with inherited stdout/stderr. On Actions, that ambient stdout is the hosted log pipe. When the runner-side log processing drops the pipe, the next
printf/eprintffrom rivet itself raiseserror writing to stream port— and because the whole command runs on those ports, a log-transport failure is conflated with a build failure.Fix
rivet-cli/main.rktwraps the command dispatch incall-with-tolerant-logging(rivet-cli/tolerant-log.rkt): both ambient ports become delegating ports whose failed write (or failed close) is treated as a completed write — the bytes are dropped, the command keeps running. The child's exit code remains the only success signal; healthy transports pass output through byte-for-byte, byte order preserved.Deliberately minimal: no child-process redirection, no buffering, no behavior change other than not dying when the sink dies.
Tests
rivet/tests/tolerant-log.rkt:Local: suite green (
raco test rivet/tests/); CLI smoke (raco rivet --help,doctor) unchanged.CHANGELOG
### Fixedentry under Unreleased.