Transcode takeover is never invoked #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context: multi-replica stateless deployment (two 2-replica apps,
cheeztvandfafflix, each one PostgreSQL plus valkey, no sticky sessions). Not a 12.0 regression — live in the deployed build. Tracking: #12.Problem
ITranscodeSessionStore.TryTakeoverAsynchas no caller in any production path.IsHaTakeoverAsynconly callsTryGetAsync, and the resuming pod then overwrites the session record withSetAsync. That is not a claim: two pods can both conclude they own the same transcode session, and the record simply reflects whichever wrote last. The Redis store's takeover logic is implemented and unit-tested, but unreachable — so the tests pass while the behaviour they describe never runs.Proposal
Wire
TryTakeoverAsyncinto the takeover path in place of theTryGetAsync+SetAsyncpair.The substance of this issue is deciding what a pod does when it loses the claim. Options, each with a real cost:
Pick one, document why, and make the losing path observable in logs.
Acceptance
TryTakeoverAsync; a test fails if the claim is performed withSetAsyncinstead.PostgreSqlTestServerin thepostgres-migration-chainWoodpecker step (JELLYFIN_TEST_POSTGRES). In-memory and fake stores have hidden different semantics — an unreachable-but-tested code path is exactly how this one was missed.