Repository navigation
fix: retry hung TV playlist reads instead of resetting playback - #24
Merged
Merged
Conversation
A single playlist read had one ten-second deadline across all attempts.
The backoff schedule alone sums to ten seconds, and a hung response on the
public edge aborted the whole read, which the player treated as fatal and
answered with a full engine reset while 15-20 seconds of media were buffered.
A 13-minute public reference run recorded five such resets ('signal timed
out'), each a 1.5-2 second loss of picture and sound with a spinner.
Each attempt now has its own four-second deadline and a timed-out attempt is
retried like a network error; only Stop ends the read.
This was referenced Oct 27, 2026
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.
Problem
A public viewer recorded five hard engine resets in a 13-minute run, all reporting
signal timed out. Each reset tore down a MediaSource holding 15-20 s of good media and gave about 1.5-2 s of lost picture and sound with a spinner.CmafPlayer.text()gave each playlist read a singleAbortSignal.timeout(10000)across all retries. The backoff schedule alone (0.5 + 1.5 + 3 + 5 s) sums to 10 s, and aTimeoutErrorwas not retryable, so one hung edge response became a fatal engine error. Receiver-side playlists stayed fast throughout (loopback p99 2 ms); the public edge occasionally hangs a single request.Change
docs/tv-player.mdupdated.Verification
tests/tv-playlist.test.mjs: hung first attempt, 503 then slow reply, Stop during a hung attempt. The hung-attempt test fails on the previous engine after exactly 10 s and passes with this change.signal timed out; this engine retried with no reset, no state change and at least 18 s of buffer throughout.