2nd call to MemoryCache.Set() with the same key erases entry if cache is full#9933
Closed
pedrobsaila wants to merge 3 commits into
Closed
2nd call to MemoryCache.Set() with the same key erases entry if cache is full#9933pedrobsaila wants to merge 3 commits into
pedrobsaila wants to merge 3 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Learn Build status updates of commit 60f05af: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
adegeo
reviewed
Jun 11, 2024
| > [!CAUTION] | ||
| > There may be transient states while the cache is full but blocks are being released on a background thread. In this state, unexpected behavior might occur if the cache is being overutilized. | ||
| > | ||
| > When updating an existing item with another one that will make cache size go beyond the limit, the existing and new items will be removed. |
Contributor
There was a problem hiding this comment.
I don't know that this makes sense. Isn't "updating an existing item with another one" actually replacing an item? The wording sounds like "replace" not "update"
Contributor
|
You can use |
|
Learn Build status updates of commit 27a2065: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Collaborator
|
I believe we can close this given that the underlying behavior was fixed in dotnet/runtime#103931. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…
Summary
These changes document a strange behaviour (though understandable) in memory cache where existing and new entries get deleted when size limit is set and exceeded
Contributes to dotnet/runtime#36039