You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET server SDK: an expired flag's cache reload blocks request threads and retries failures one at a time #419
.NET server SDK: a flag's cache reload blocks request threads, and failed reloads are retried one waiter at a time
Versions: LaunchDarkly.ServerSdk 8.11.0, LaunchDarkly.ServerSdk.Redis 5.1.1, LaunchDarkly.OpenFeature.ServerProvider 2.1.2, .NET 10. Streaming data source, Redis persistent store, 60 s cache TTL.
What we saw: after moving to StackExchange.Redis 3, which by default reads replies on the shared .NET thread pool (instead of a dedicated thread pool in v2), our production pods were restarted for thread-pool starvation with CPU near idle. The restart we traced began when two flags' cache entries expired. Redis timeouts for the same flag keys then repeated exactly 5 s apart.
Cause in the SDK:
An expired entry is evicted rather than refreshed. The next evaluation reloads it synchronously under a per-key lock (LaunchDarkly.Cache, CacheImpl.MaybeComputeValue), and every other evaluation of that flag blocks a thread on that lock.
A failed load caches nothing, so each waiter reloads in turn. The Nth waiter waits N times the store timeout.
An async store doesn't avoid this. PersistentStoreAsyncAdapter blocks with StartNew(...).Unwrap().GetAwaiter().GetResult(), so the read also needs pool threads while the caller is blocked.
Asks:
Bring the Java SDK's StaleValuesPolicy (REFRESH, REFRESH_ASYNC) to .NET: serve the cached value while one background refresh runs, and keep it if the refresh fails.
Share one load's result with every concurrent waiter, including a failure.
Provide an async evaluation path all the way through, so waiting evaluations don't hold threads.
Question: when every process streams, do you recommend CacheForever, given its warning about stale data when processes share a store?
We've worked around it for now by turning on StackExchange.Redis's DedicatedThreads option.
Activity
tanderson-ld commentedon Nov 20, 2026
Hi @dgioulakis , we'll dig in and get back to you shortly.