A poll during a cold tune's first pull gets an empty playlist #69

Closed
opened 2026-10-31 13:55:42 -04:00 by cmoriarty · 1 comment
Owner

What happens

A cold tune adopts its stream (Channel._adopt, which sets self.entry) and then waits for its first pull's downloads. A second poll that arrives in that window finds self.entry set, 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.

  • The script's poll (port 53337) ran the cold tune and was answered at 17:45:24.7.
  • ffmpeg's two requests (53338, 53339) were answered at once, at 17:45:21.9 and 17:45:22.1, empty.
  • ffmpeg quit without requesting a segment.

A cold tune of Bruins vs. Blackhawks a few minutes later, with one request first, played fine.

This predates the Stream reliability batch: _cold_start has 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.

## What happens A cold tune adopts its stream (`Channel._adopt`, which sets `self.entry`) and then waits for its first pull's downloads. A second poll that arrives in that window finds `self.entry` set, 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. - **The script's poll (port 53337)** ran the cold tune and was answered at 17:45:24.7. - **ffmpeg's two requests (53338, 53339)** were answered at once, at 17:45:21.9 and 17:45:22.1, empty. - **ffmpeg** quit without requesting a segment. A cold tune of Bruins vs. Blackhawks a few minutes later, with one request first, played fine. This predates the Stream reliability batch: `_cold_start` has 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.
Author
Owner

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.

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.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker#69
No description provided.