Shared-config and library-visibility changes do not propagate between replicas #15
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
Two caches over the same shared
/configvolume never invalidate:Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs:22,31reads the shared/config/*.xmlonce and caches it.ConfigurationUpdatedis an in-process event only.MediaBrowser.Controller/Entities/CollectionFolder.cs:35holds astatic_libraryOptionsdictionary (GetOrAddat:173,Clear()at:194, called from only two local sites). It gates per-user library visibility viaIsVisible().So an admin who disables a library, remaps a library path, or tightens a security setting on one pod sees it apply on that pod and silently not apply on the others until they restart. Library visibility is a permissions boundary, so the stale pods keep serving content that is supposed to be hidden.
Filed as one issue because both need the same fix.
Proposal
One invalidation mechanism covering both caches:
/configdirectory and clear both caches on change. No new dependency, but change notification is unreliable on some shared volume types, so it needs a polling fallback.Acceptance
IsVisible()for an affected user returns false without a restart.BaseConfigurationManager.PostgreSqlTestServerintests/Jellyfin.Server.Testsand run in thepostgres-migration-chainWoodpecker step (JELLYFIN_TEST_POSTGRES). In-memory providers have hidden different semantics and are how three bugs reached production.