Repository navigation
fix(cap-muxer): finish the open fragment when the recorder dies - #2644
Merged
Merged
Conversation
Member
Author
|
hey @greptileai, please re-review the PR |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
When the recorder dies while the experimental out-of-process muxer is recording,
cap-muxeris supposed to see EOF on stdin and finish the fragment it has open. It panics instead, because the recorder's end of its stderr pipe is gone, and the open fragment is left as a 0-byte.tmp.sequenceDiagram participant R as Recorder participant M as cap-muxer R--xR: SIGKILL (stdin and stderr pipe readers close) M->>M: stdin EOF: "stdin closed without Finish" M->>M: tracing writes the line to stderr: EPIPE M->>M: tracing-subscriber reports the write error with eprintln!: panic (exit 101) Note over M: write_trailer never runs: segment_NNN.m4s.tmp stays 0 bytestracing_subscriber::fmt()reports a failed write witheprintln!, which panics on a closed stderr; the error paths inmainusedeprintln!too (crates/cap-muxer/src/main.rs:22).log_internal_errors(false), and the exit messages go throughwriteln!(io::stderr(), ..)with the error ignored, so a lost stderr never stops the muxer from finishing.Effect
crates/cap-muxer/tests/orphaned.rsfeeds 75 libx264 frames (keyframe every 30) to the real binary, closes its stderr reader, then stdin:Engine-verify
crashsuite, Blacksmith macOS, recorder killed mid-fragment with the out-of-process muxer (on top of the per-packet flush, #2643):.tmp: frames 120-175 lost.tmp: frames 60-120 lost.tmpRecovery keeps the finished fragment only with the pending-fragment recovery fix (#2640): the recorder's manifest still lists it as pending.


Confidence Score: 5/5
The PR appears safe to merge; both previous concerns are addressed.Summary
Makes stderr writes non-panicking so
cap-muxercan finish its open fragment after the recorder dies.Reviews (2) · Last reviewed commit: "test(cap-muxer): always log the EOF warn..." · Reviewed by Greptile