Skip to content

[bug] Stopping playback can leave its transcode running on the node for 10 minutes #2265

Closed

Description

@Quick104

What happened

Stopping a transcoded playback can leave its encoder running on the remote transcode node for about 10 minutes.

The stop kills the node's FFmpeg. A segment request for the same session that is still in flight then reaches the node about 100 ms later. The node has no job for that session, treats it like a client returning after a node restart, and rebuilds the job from the request's stream token. Nothing is watching, and the rebuilt FFmpeg keeps encoding until the node's idle reaper closes it 10 to 11 minutes after the last request. For that whole time it holds a hardware encode session and node CPU.

On a Silo dev deployment with two Intel QSV transcode nodes, 7 of 24 web playbacks in one test run left an encoder running like this. Each playback was a 720p transcode in Chrome or Firefox, stopped after about 10 seconds. The 7 encoders were still running 4 to 9 minutes after their stops. For each of them, the node logged transcode node session reconstructed from token within about 100 ms of the stop killing the original FFmpeg.

Steps to reproduce

  1. Use a Silo deployment with at least one remote transcode node.
  2. In the web app, play a title that needs a transcode. To force one, pick 720p in the player's quality menu.
  3. After about 10 seconds, stop playback (DELETE /api/v2/playback/{session_id}) and leave the player page.
  4. On the node, list FFmpeg processes and their ages, or search the node log for the session ID.
  5. Repeat with several titles. In the run above, 7 of 24 stops left an encoder running.

Expected behavior

After a stop, nothing serves, rebuilds, or encodes for that session. The stop path records a deny marker so that no replica or node serves the session again. The node should honor that for in-flight requests too.

Silo version / commit

A dev build of c32feb16d (origin/main) with unmerged changes that don't touch playback stop or the transcode node's session handling. Also seen earlier the same day on a build of c32feb16d plus an unrelated branch.

Deployment

Docker Compose

Area

Playback and transcoding

Clients affected

  • Web UI
  • Android
  • iOS/tvOS/macOS
  • Jellyfin-compat client (Infuse, Findroid, ...)
  • Other/not client-specific

Client app and device

Chrome for Testing 153 and Firefox 155 on Linux.

Media and playback details

HEVC HDR10, HLG, Dolby Vision 8.1, AV1 and VP9 sources, transcoded to 720p H.264 with h264_qsv on the node. The source format doesn't matter.

Relevant logs

API log for the stop, raw apart from the marked redactions:

time=2026-10-11T14:57:24.802Z level=INFO msg="apiv2 request" component=apiv2 request_id=f0e9aa2aac01ae307dd01114 api_major=2 operation_id=stopPlayback method=DELETE path_pattern=/api/v2/playback/{session_id} status=200 status_class=2xx error_code=none auth_class=session duration_ms=115 body_bytes=189 client_ip=[redacted] user_id=[redacted]

Node log for the same session, raw apart from the marked redactions:

time=2026-10-11T14:57:10.669Z level=INFO msg="ffmpeg event" component=ffmpeg playback_session_id=3647cac3-ff39-4a82-82c6-3112e2d3f8ad-dcbbb2dbd69d-8ab08274 node_id=[redacted] node_type=transcode execution_mode=transcode_node restart_count=0 target_resolution=720p target_video_codec=h264 target_audio_codec=aac hw_accel=qsv seek_seconds=600 start_segment_number=300 input_path="[redacted]" output_dir=[redacted] ffmpeg_event="ffmpeg process starting"
time=2026-10-11T14:57:24.789Z level=INFO msg="ffmpeg event" component=ffmpeg playback_session_id=3647cac3-ff39-4a82-82c6-3112e2d3f8ad-dcbbb2dbd69d-8ab08274 node_id=[redacted] node_type=transcode execution_mode=transcode_node restart_count=0 target_resolution=720p target_video_codec=h264 target_audio_codec=aac hw_accel=qsv seek_seconds=600 start_segment_number=300 input_path="[redacted]" output_dir=[redacted] ffmpeg_event="ffmpeg process exit error" exit_error="exit_code=-1: signal: killed"
time=2026-10-11T14:57:24.891Z level=INFO msg="ffmpeg event" component=ffmpeg playback_session_id=3647cac3-ff39-4a82-82c6-3112e2d3f8ad-dcbbb2dbd69d-8ab08274 node_id=[redacted] node_type=transcode execution_mode=transcode_node restart_count=0 target_resolution=720p target_video_codec=h264 target_audio_codec=aac hw_accel=qsv seek_seconds=694 start_segment_number=347 input_path="[redacted]" output_dir=[redacted] ffmpeg_event="ffmpeg process starting"
time=2026-10-11T14:57:24.891Z level=INFO msg="transcode node session reconstructed from token" component=transcodenode session=3647cac3-ff39-4a82-82c6-3112e2d3f8ad-dcbbb2dbd69d-8ab08274 playback_session_id=3647cac3-ff39-4a82-82c6-3112e2d3f8ad-dcbbb2dbd69d-8ab08274 requested_segment=347 start_segment_number=347

At 15:06:27Z, nine minutes after the stop, ps on the node still showed that session's FFmpeg, 542 seconds old.

Technical notes

From reading the source at c32feb16d; the exact interleaving was not traced live.

  • handleStop in internal/transcodenode/server.go records a tombstone (stoppedProgressiveRemuxes) only for progressive remux. A stopped HLS transport leaves nothing behind, so the next manifest or segment request carrying a complete recipe token rebuilds it (reconstructFromToken → spawnReconstruct).
  • The node does check the deny marker before rebuilding (sessionDenied), but StreamDeny caches a "not denied" answer for 2 seconds per process (streamDenyCacheTTL in internal/playback/streamdeny.go) and fails open on Redis errors. The API writes the marker and updates its own cache. It can't update the node's cache, so a node that checked the session within the last 2 seconds still answers "not denied".
  • spawnReconstruct re-checks only whether a job is registered after taking the session lifecycle lock. It doesn't re-check the deny marker or any stop record.
  • The sessionIdleTTL comment in server.go already names a related case: a replan retires a transport ID and a stale in-flight token resurrects it. The reaper is the only backstop for both.

A likely fix: in handleStop, record every stopped transport ID with a MaxTokenTTL expiry, the way progressive remux stops already are. Check that record (and the deny marker, uncached) in spawnReconstruct after taking the lifecycle lock, and refuse with 410. That covers this race and the retired-transport case.

#666 is a different leak: sessions that are never stopped because progress updates keep them alive.

AI harness

Claude Code in T3 Code

AI tool(s)

Claude Code, GitHub CLI, Playwright

AI model(s)

claude-opus-5-5

AI involvement

AI-drafted at the maintainer's direction, from a reproduction on a Silo dev deployment and source review at c32feb16d.

Independent or adversarial review

n/a

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: found while testing HDR tone mapping for #1999 on a Silo dev deployment.

Activity

  1. added
    bug
    on Oct 11, 2026
  2. added
    priority: P1
    on Oct 11, 2026
  3. added a commit that references this issue on Oct 21, 2026
    f5d5f3f
  4. added a commit that references this issue on Oct 21, 2026
    799823e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions