fix(engine): preserve streaming encoder termination diagnostics - #3751
Closed
jrusso1020 wants to merge 1 commit into
Closed
fix(engine): preserve streaming encoder termination diagnostics#3751jrusso1020 wants to merge 1 commit into
jrusso1020 wants to merge 1 commit into
Conversation
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.
What
Preserve the streaming encoder's termination reason and frame counts in both
getExitError()(used by capture-loop early failures) andclose(). Watchdog termination remains a failure even if the child exits with code zero.Why
Addresses the remaining observability gap in #3744. On current main,
ManagedChildProcessknows whether it requested termination for inactivity or cancellation, butgetExitError()discards that reason.close()only includes the timeout context on its nonzero-exit path. Neither error records how many frames were attempted or accepted.The reported v0.6.52 also had an older backpressure bug: it reset the watchdog only when
stdin.write()returned true, never after a buffered write drained, and capture callers ignored the return value. #1372 already added drain waiting, heartbeat refresh after drain, and capture-loop stop guards. That is a plausible mechanism for the old report, but the original composition is unavailable and the actual SIGTERM sender cannot be established from the supplied logs.How
Snapshot attempted/accepted frame counts and pending-drain state immediately before a managed termination request, or at process settlement for other exits. Accepted counts writes queued by Node, including writes returning false; it does not claim FFmpeg encoded those frames. Late write attempts cannot overwrite the snapshot. Both error surfaces share the formatter and preserve external-interruption retry classification.
For slow software capture, use a current release with #1372 first. A progressing render can exceed the total inactivity budget. If disk-backed capture is needed,
PRODUCER_ENABLE_STREAMING_ENCODE=falseselects that path;PRODUCER_ENABLE_CHUNKED_ENCODE=truealone does not disable streaming. This change leaves those defaults unchanged.Test plan
ensureFrameWrittentests pass.