Repository navigation
fix(transcodenode): wait for a rebuild's own manifest before taking it as ready - #4251
Conversation
…t as ready A rebuild on a transcode node reuses the lost session's output directory. Under a backend with a software retry (VideoToolbox, or QSV/VAAPI on a node with no render device) it waited with WaitForManifest, which accepts any manifest in the directory, and skips the startup-files check once FFmpeg has exited. A process that died at startup was then ready from the previous process's manifest: the rebuild registered a session that served nothing, and the software retry never ran. Both waits now use WaitForGenerationManifest, which accepts only a manifest the current process wrote. The dead start reads as failed, so the software retry runs, and a retry that also fails is not registered. Closes Silo-Server#4099 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 4 minutes. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed head: No findings. Both readiness waits in Verification
Follow-up. The same review found a separate problem that's already on Validated features. I couldn't read the 1.0 validation board for this run. From the code, the change only reaches rebuilds on a transcode node whose backend has a software retry (VideoToolbox, or QSV/VAAPI without a render device), so User manual. Unaffected: no setting, label, or documented behavior changes. Other clients. N/A: the change is internal to the transcode node. Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
|
Problem
Closes #4099
Related issue: #4097 (changed the lines next to these; merged)
Validation tasks: none
Other clients: N/A. The change is in the transcode node's rebuild; a client of a rebuilt session gets a working stream instead of one that serves nothing.
A rebuild on a transcode node reuses the lost session's output directory, which still holds the previous process's
stream.m3u8and segments. Under a backend that has a software retry (VideoToolbox, or QSV/VAAPI on a node with no render device), the rebuild waited withWaitForManifest. That accepts any manifest in the directory, and skips the startup-files check once FFmpeg has exited (s.runningis false). A hardware process that died at startup was therefore ready from the old manifest: the node registered a session that served nothing, and the software retry that should have run was skipped.This PR has no dependencies and can merge in any order. #4097, which the issue said to follow, is merged.
Approach
spawnReconstruct(internal/transcodenode/server.go), the hardware start's and the software retry's, useWaitForGenerationManifest, which accepts only a manifest the current FFmpeg generation wrote. That is the wait the issue names.TestSpawnReconstructDoesNotRegisterFailedSoftwareRetryalready expects for an empty directory.Validation
gofmt,go vetand the changed-lines lint are clean.TestSpawnReconstructIgnoresThePreviousProcessManifest: the existing failed-retry setup (a fake FFmpeg whose real attempts all exit) plus an oldstream.m3u8and six segments in the session's output directory. It checks that the rebuild returns an error, registers nothing, and made two attempts, hardware and the software retry.main'sWaitForManifest, the rebuild takes the dead process as ready and goes on to register it, reachings.tracker.NodeURL()(server.go:2378), which panics because the test server has no tracker. The test therefore fails onmain; it never gets back a session to check.go test ./internal/transcodenode/passes.make test-go.Evidence
No visible change. The evidence is what the rebuild does with an old manifest in its directory, from the test on WSL2 (Ubuntu,
go1.26.4 linux/amd64),mainat7fc39fbd0, this PR at the head of this branch.mainRisks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Fix
transcodenode.Server.spawnReconstructreadiness to require current-process manifestThe reconstructed session and the software-encoding retry both reuse the output directory, so a manifest left by a previous process could falsely mark the session ready. Both readiness checks in server.go now wait for a manifest written by the current process.
TestSpawnReconstructIgnoresThePreviousProcessManifest, that seeds an existing HLS manifest and segments, fails both ffmpeg attempts, and confirms an error is returned, the session is not registered, and both hardware and software encoding are tried.Macroscope summarized bf30719.