A poll during a cold tune's first pull gets an empty playlist #69
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
cmoriarty/sports-breaker#69
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
A cold tune adopts its stream (
Channel._adopt, which setsself.entry) and then waits for its first pull's downloads. A second poll that arrives in that window findsself.entryset, skips the cold tune, and renders the still-empty timeline: a live playlist with no segments. ffmpeg gives up on that ("Output file does not contain any stream") without asking for a single segment.Seen live, 2026-10-31 17:45 UTC
A test tune of Spurs vs. C Palace opened the playlist twice at once: the test script's poll and an ffmpeg reader.
A cold tune of Bruins vs. Blackhawks a few minutes later, with one request first, played fine.
This predates the Stream reliability batch:
_cold_starthas always adopted the stream before pulling. It's rare in use, since a media server makes one request and then reads, but two viewers tuning at once, or a probe beside a reader, would meet it.The fix
In
Channel.playlist, a poll while a cold tune is pending (_cold_pending()) waits on the same cold task, with the same 2 s cap and filler fallback, as when the entry is still empty. The test: two polls at once on a cold channel both get segments.Closing: deployed 2026-10-31 18:18 UTC (PR #70,
074a7dd).A poll while a cold tune is still pulling now waits on that tune. The test fails without the fix, the second poll getting
[].Live: tunes on production since the deploy (NC State vs. California, with the first request alone) answered with segments. The race itself needs two polls at once, so the test is its evidence.