-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Title: Redis caching: Notification queue not suspended when background task queue is overloaded
Description
The RedisCacheDependencyGarbageCollector does not respond to IsBackgroundTaskQueueOverloadedChanged events by suspending the notification queue processing.
Current Behavior
When the background task scheduler becomes overloaded:
- Individual notifications are skipped in
ProcessKeyspaceNotification(the code checksIsBackgroundTaskQueueOverloadedand logs a warning) - However, the notification queue continues receiving notifications from Redis
- This can cause memory buildup as notifications pile up in the
BlockingCollection
Expected Behavior
When IsBackgroundTaskQueueOverloadedChanged fires and the queue is overloaded:
RedisNotificationQueue.SuspendProcessing()should be called to pause the processing thread- When the queue recovers,
ResumeProcessing()should be called
The SuspendProcessing() and ResumeProcessing() methods already exist in RedisNotificationQueue but are not wired up to the overload event.
Affected Files
PostSharp.Patterns.Caching.Backends.Redis/RedisCacheDependencyGarbageCollector.csPostSharp.Patterns.Caching.Backends.Redis/RedisNotificationQueue.cs
Filed by Claude on behalf of the Metalama team while porting caching resilience features.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels