fix(api): log ffmpeg stderr when a streamed render fails - #297
Merged
Conversation
Streamed ffmpeg renders (mixdown export, region trims, stem MP3, video mux) sent stderr to DEVNULL. When ffmpeg died mid-stream the client received a truncated file with HTTP 200 already committed -- and no trace of the failure existed anywhere, making "my export is broken" reports unsolvable. stderr is now drained into a bounded tail (mandatory anyway once it is a pipe -- an undrained full pipe would deadlock ffmpeg) and logged at WARNING with a per-endpoint context (job id, format, stems) when the process exits non-zero. Kills we initiated on client disconnect are expected and stay silent; EOF-then-nonzero is the failure signature, since returncode stays None until wait() even for an exited child. Closes #280
8 tasks
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 #280. Phase 1 of #272 — plan: #272 (comment) (PR-1D).
What
_stream_ffmpeg(mixdown export, stem region trims, stem MP3 region, video mux) sent stderr toDEVNULL. If ffmpeg died mid-stream, the user downloaded a truncated file under an already-committed HTTP 200 — and the failure left no trace anywhere.mixdown job=… ext=… stems=…) + the stderr tail.returncode(which staysNoneuntilwait()reaps the child even when it already exited — caught by the new test, fixed).Testing
_stream_ffmpegwith a Python stub subprocess: failure logs context + stderr tail while still delivering the partial stream; clean exit logs nothing. Cross-platform, no ffmpeg needed.ruff check+ruff format --checkclean.🤖 Generated with Claude Code