Repository navigation
fix(playback): replan around a transcode or proxy node that stopped answering - #2292
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9b9470cf2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A dead-node replan keeps the failed recipe, so a progressive remux under worker-only routing came back as a remux whose only proxy was the dead one, and failed on route capacity. Count only proxies the replan found answering when deciding whether the remux has a route. Also compare echoed plan keys trimmed, as planning does.
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:
|
Problem
Related issue: #1176
Validation tasks: unblocks #1177 C3, #1178 C2; changes #1250 C5, #1252 C5 (multi-node setups only)
When a transcode node or a proxy dies mid-stream, the replan a client sends to recover can hand back the same dead route, and playback stays on a spinner. In the web player this happens whenever the node dies less than about 30 seconds before the next health sweep and media goes through a proxy, which is the default once a proxy is registered. The Activity page then keeps listing the session on the dead node as paused at 0:00.
The pool's health flag only changes at the sweep, so until then the dead node still looks healthy:
track_changereplan that changes nothing. That replan keeps the running HLS transport while its route is still allowed, so it returns the dead node's URL.failure_recoveryreplan, which the Apple and Android apps send, gets a new transport, but the session sticks to its current transcode node and is offered the same proxy again. It also counts the plan as failed, so a second recovery can end inadaptation_exhaustedeven though only the node failed.A replan now first asks the session's transcode node and egress proxy whether they answer, with a two-second bound. A node that doesn't answer is left out of that replan: its capabilities aren't used for planning, its transport isn't reused, the route resolver doesn't select it, and it degrades its co-location group as a failed health check would. A recovery from such a node keeps the failed plan eligible, so the same recipe runs on another node or on this server.
seek_reanchorkeeps its route as before.Approach
Unreachableonnodepool.RouteRequest. Counting the node as unhealthy for group health is what keeps a grouped transcode node from being paired with another group's proxy when its own proxy died. Other proxy filters, such as network-access reachability, keep their current behavior.docs/architecture/playback-protocol-v3.mdnow says that keeping the current route eligible doesn't keep a dead node, and that a recovery from one doesn't exclude its plan.Validation
track_changeandfailure_recoveryreplans against two fake nodes, keeping a working transport and moving off a dead one with the same recipe; and the planner degrading the group of an unreachable node. The new tests fail without the change; the handler tests pass under-race.502, and stayed on a spinner; Activity kept the session on the dead node.failure_recovery) got its new plan 2.1 seconds after the first failed segment, without a stall.hw_accelset toautoon this macOS test host, a replan also pays about 2 seconds of local VideoToolbox detection, which put a few runs at 10.0 to 10.2 seconds; that cost isn't part of this change.go build,gofmt,go vet,make lint-changed, the web lint, format, build, budget and tests, and everyverify-*target pass.make test-gofails on this macOS host inapiv2,intromarkers,jellycompat,playback,proxyandtranscodenode(hardware probes and timing); every failing test fails the same way onmainon this host, and the packages this change touches (api/handlers,nodepool,noderouting) pass.Evidence: https://evidence.siloserver.org/r/silo-server/pr-2292/
Risks
Checklist
AI Disclosure