Skip to content

Conversation

@nikcio
Copy link

@nikcio nikcio commented Nov 25, 2025

Fixes #553

Implements a check before removing distributed values from the cache to skip removal when the options are using failsafe to allow a factory failure to use the stale value.

More information is noted on the issue. Let me know if this approach is appropriate to fix the issue 😄

Copilot AI review requested due to automatic review settings November 25, 2025 15:00
Copilot finished reviewing on behalf of nikcio November 25, 2025 15:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an issue where distributed cache values were being removed even when fail-safe was active. The fix adds a check in the DistributedExpireEntry methods (both sync and async versions) to skip the distributed cache removal operation when fail-safe is enabled, allowing stale values to remain available for use during factory failures.

Key Changes:

  • Modified DistributedExpireEntry in FusionCache_Sync.cs to return early with success when fail-safe is enabled
  • Modified DistributedExpireEntryAsync in FusionCache_Async.cs with the same fail-safe check
  • Backplane notification still occurs to inform other cache instances of the expiration event

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs Added fail-safe check to skip distributed cache removal during entry expiration
src/ZiggyCreatures.FusionCache/FusionCache_Async.cs Added fail-safe check to skip distributed cache removal during entry expiration (async version)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Distributed cache entry removed after expire tag even when fail safe is enabled

1 participant