Skip to content

[bug] API replica performing local transcoding when "Any worker only" transcode routing is set #4601

Done

Description

@jasonpanosso

What happened

In an environment with multiple API replicas and transcode nodes, the "Any worker only" transcode routing option is ignored under certain conditions. When this happens, an API-only replica will begin transcoding locally.

Steps to reproduce

  1. Run two API replicas behind a load balancer without session affinity, with Redis and one transcode node, and transcode routing set to "Any worker only".
  2. In Silo Web, start direct play of a file.
  3. On the client, lower the quality to force transcoding
  4. Watch logs, see that an API server starts local transcoding (or, CPU/mem usage if hw transcoding is not available)

Expected behavior

I would expect that the transcoding node would always handle transcoding, never an API replica

Silo version / commit

ghcr.io/silo-server/silo-server:build-2573@sha256:7b6aa63aa00aeb133489848869b7bde07738f86fcccbc341afcbae26aaf8ca3f

Deployment

Kubernetes

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

No response

Media and playback details

No response

Diagnostics report reference

No response

Relevant logs

order of HTTP requests

time (UTC) replica request result
19:32:43.914 A POST /api/v2/playback/{session_id}/replan transcode started on the transcode node
19:32:43.970 B GET /api/v2/playback/transcode/{session_id}/master.m3u8 reconstructed locally (log: "transcode process reconstructed from recipe card")
19:32:44.021 A GET /api/v2/playback/transcode/{session_id}/segment/{name} 200, relayed from the transcode node

Replica A

{
    "time": "2026-11-19T19:32:43.878229344Z",
    "level": "INFO",
    "msg": "playback transport startup timing",
    "component": "playback",
    "transport": "remote",
    "session": "db43c750-2a67-495b-9eb9-60bed7f8eff7",
    "total_ms": 1059,
    "status": 202,
    "outcome": "ready"
}

Transcode node

{
    "time": "2026-11-19T19:32:42.825478748Z",
    "msg": "ffmpeg event",
    "execution_mode": "transcode_node",
    "hw_accel": "qsv",
    "target_video_codec": "h264",
    "seek_seconds": 4726,
    "start_segment_number": 2363,
    "output_dir": "/tmp/silo-transcode/db43c750-2a67-495b-9eb9-60bed7f8eff7-b4333ce1affb-6fe8728c",
    "ffmpeg_event": "ffmpeg process starting"
}

Replica B

{
    "time": "2026-11-19T19:32:43.962760046Z",
    "level": "INFO",
    "msg": "transcode process reconstructed from recipe card",
    "component": "playback",
    "session": "db43c750-2a67-495b-9eb9-60bed7f8eff7",
    "playback_session_id": "db43c750-2a67-495b-9eb9-60bed7f8eff7",
    "requested_segment": -1,
    "start_segment_number": 2363
}
{
    "time": "2026-11-19T19:32:44.481110721Z",
    "level": "INFO",
    "msg": "transcode segment missing",
    "component": "api",
    "segment": "seg_02366.ts",
    "requested_segment": 2366,
    "produced_head": 2362,
    "last_requested_segment": 2363,
    "start_segment_number": 2363,
    "last_produced_age_ms": -1,
    "wait_timeout_ms": 3500,
    "restart_on_timeout": true,
    "reason": "startup_request_beyond_window",
    "session": "db43c750-2a67-495b-9eb9-60bed7f8eff7"
}
{
    "time": "2026-11-19T19:32:44.493674207Z",
    "level": "INFO",
    "msg": "transcode seek restart",
    "component": "api",
    "segment": "seg_02366.ts",
    "requested_segment": 2366,
    "produced_head": 2362,
    "reason": "startup_request_beyond_window",
    "seek_seconds": 4732,
    "session": "db43c750-2a67-495b-9eb9-60bed7f8eff7"
}
{
    "time": "2026-11-19T19:32:45.951439196Z",
    "level": "INFO",
    "msg": "transcode seek restart",
    "component": "api",
    "segment": "seg_02369.ts",
    "requested_segment": 2369,
    "produced_head": 2366,
    "reason": "request_beyond_produced_window",
    "seek_seconds": 4738,
    "session": "db43c750-2a67-495b-9eb9-60bed7f8eff7"
}

Technical notes

No response

AI harness

none

AI tool(s)

none

AI model(s)

n/a

AI involvement

No AI used

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

Activity

  1. added
    bug
    on Nov 19, 2026
  2. added
    priority: P2
    triaged
    on Nov 19, 2026
  3. blurbery commented on Nov 19, 2026

    @blurbery
    Contributor

    Thanks for the detailed logs, they pointed straight at it. Replica B still held its own copy of the session from the direct-play start, with no node on it, so when the manifest request landed there it rebuilt the transcode from the new token as a local FFmpeg, even though the token named the node.

    Fix is in #4604 (draft for now): a replica whose copy names no node now relays to the node the token names instead of transcoding locally, and the rebuild path refuses any recipe that names a node. I reproduced it with two API replicas, Redis, one transcode node and "Any worker only": on main replica B started a second encode, with the fix it relays the node's playlist and only the node encodes.

  4. added a commit that references this issue on Nov 24, 2026
    835e488
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: P2triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions