Skip to content
Discussion options

You must be logged in to vote

The cache won't evict an entry if expiration is reset during its removal as that race causes its eviction to be aborted. If you are adding right after it expires then you might consider your own lifecycle variable to detect and no-op in the listener. One approach could be to delay processing the removal notifications until a grace period passes so you can check and skip if it should actually do the work, which you could implement in your custom listener.

Expiration is specified to have a built-in ~1 second (2^30 ns) delay. Internally the cache uses an O(1) priority queue based on hashing, where that is the smallest bucket size, so the entry would expire within that time interval while the…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ben-manes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants