Skip to content

Fix live HLS downloader not stopping on first Ctrl+C#59

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-ctrl-c-hls-stream-download
Draft

Fix live HLS downloader not stopping on first Ctrl+C#59
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-ctrl-c-hls-stream-download

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

When downloading live HLS streams, the first Ctrl+C logged a stop message but did not actually stop the downloader if it was blocked waiting for the next segment batch. Users had to press Ctrl+C again to force exit.

  • Downloader stop behavior

    • Updated ParallelDownloader::download to race stream polling against the stop signal.
    • Replaced post-iteration termination checking with immediate interruption via tokio::select!, so stop is honored even while waiting on stream.next().
  • Regression coverage for live-wait scenario

    • Added a focused test that simulates a live source with delayed next batch emission.
    • Verifies downloader exits promptly after stop signal instead of waiting for the delayed batch.
  • Test clarity cleanup

    • Removed unnecessary boxing in the test stream construction.
    • Replaced inline delay literal with a named constant for intent readability.
while let Some(segments) = tokio::select! {
    _ = &mut self.stop_signal => None,
    segments = stream.next() => segments,
} {
    // process segment batch
}

Copilot AI and others added 2 commits April 16, 2026 15:52
Agent-Logs-Url: https://github.com/iori-rs/iori/sessions/d89549a3-4b05-49a8-8d06-09635b14fe41

Co-authored-by: Yesterday17 <8667822+Yesterday17@users.noreply.github.com>
Agent-Logs-Url: https://github.com/iori-rs/iori/sessions/d89549a3-4b05-49a8-8d06-09635b14fe41

Co-authored-by: Yesterday17 <8667822+Yesterday17@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Ctrl + C not stopping HLS stream download Fix live HLS downloader not stopping on first Ctrl+C Apr 16, 2026
Copilot AI requested a review from Yesterday17 April 16, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

下载hls直播流时,第一次输入Ctrl + C不会停止程序

2 participants