Skip to content

fix(live): ending an HLS session leaves a reader others still use - #270

Merged
SteveGilvarry merged 1 commit into
masterfrom
fix/256-reaper-keeps-shared-reader
Oct 30, 2026
Merged

SteveGilvarry merged 1 commit into
masterfrom
fix/256-reaper-keeps-shared-reader

Conversation

@SteveGilvarry

Copy link
Copy Markdown
Member

The idle reaper ends a live session 90 s after its last HLS fetch, and
stop_session stopped the monitor's stream-socket reader with it. A
WebRTC, WHEP or RTSP viewer reads from that same reader and never
touches the HLS session, so it lost its video a minute or two in.

stop_session now waits for the session's task to finish and stops the
reader only if nothing else subscribes to it. A reader it leaves running
is remembered, and the idle watchdog stops it on a later pass once
nothing reads it and no new session has taken it back. With nobody left
at the time, the reader stops at once as before.

Fixes #256

🤖 Generated with Claude Code

https://claude.ai/code/session_01KXE4e1KGijmQSLUde9ydBZ

The idle reaper ends a live session 90 s after its last HLS fetch, and
stop_session stopped the monitor's stream-socket reader with it. A
WebRTC, WHEP or RTSP viewer reads from that same reader and never
touches the HLS session, so it lost its video a minute or two in.

stop_session now waits for the session's task to finish and stops the
reader only if nothing else subscribes to it. A reader it leaves running
is remembered, and the idle watchdog stops it on a later pass once
nothing reads it and no new session has taken it back. With nobody left
at the time, the reader stops at once as before.

Fixes #256

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXE4e1KGijmQSLUde9ydBZ
@SteveGilvarry
SteveGilvarry merged commit edda210 into master Oct 30, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idle reaper stops the shared reader after 90 s even while a WebRTC peer is watching

1 participant