Skip to content

Make Jellycompat audio selection generation-safe across API replicas #749

Open

Description

@Quick104

Problem

Jellyfin-compatible audio selection and remote-transcode replacement are not serialized across API replicas. The current playback state and recipe checks fail closed before serving bytes, but two API pods can still race while switching tracks: selection, node replacement, and recipe publication can land in different orders. A failed remote replacement also stops the working job before the candidate has proved ready, causing avoidable playback interruption until reconstruction.

This is most visible during rolling deployments or simultaneous client reports. It is an availability and coordination gap, not a path for serving audio from the wrong downmix recipe: the versioned playback routes reject mismatched runtime facts.

Acceptance criteria

  • Give each durable Jellyfin-compatible audio selection a monotonic generation.
  • Carry that generation through node start/adoption, readiness receipts, recipe publication, reconstruction, cleanup, and rollback.
  • Reject stale node starts and recipe publications without disturbing a newer selection.
  • Replace a remote transcode atomically, or restore the previous recipe immediately when the candidate cannot become ready.
  • Cover concurrent switches from separate API-server instances and mixed-version rolling deployments.

Context

Follow-up to #748. That PR adds process-local transaction handling and fail-closed byte-route validation for the stereo-downmix recipe; this issue covers the remaining cross-replica continuity guarantee.

Activity

  1. added
    bug
    triaged
    and removed
    triaged
    on Sep 20, 2026
  2. added theissue type on Sep 20, 2026
  3. removed
    bug
    on Sep 20, 2026
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions