Cache: rework overshoot handling since Caffeine 3.2.3#11564
Closed
snazy wants to merge 1 commit intoprojectnessie:mainfrom
Closed
Cache: rework overshoot handling since Caffeine 3.2.3#11564snazy wants to merge 1 commit intoprojectnessie:mainfrom
snazy wants to merge 1 commit intoprojectnessie:mainfrom
Conversation
15b2fbc to
2cb620f
Compare
Member
|
How do we want to proceed wrt caffeine upgrade #11553? This PR first? or last? |
There is sadly no fix possible with Caffeine since 3.2.3. See [this reply](ben-manes/caffeine#1897 (comment)). The workaround I came up with is to change the logic a bit: * If the cache-weight is less than the capacity: just put the entry to the cache, no "special handling". * Otherwise do the following while holding an exclusive lock: * Explicitly trigger cache cleanup * If the cache-weight is less than the admitted capacity (overshooting), put the entry into the cache. * Else, reject and update meters accordingly. We have to allow the "overshooting" to happen to enable (and trigger) the cache cleanup. Otherwise, cleanup would never happen ...
2cb620f to
78d5d4c
Compare
Member
Author
|
🤦 i thought that PR was already merged. Let me close this one and cherry-pick the commit onto #11553 |
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.
There is sadly no fix possible with Caffeine since 3.2.3. See this reply.
The workaround I came up with is to change the logic a bit:
We have to allow the "overshooting" to happen to enable (and trigger) the cache cleanup. Otherwise, cleanup would never happen ...