Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange issue with OnEviction/OnInsertion hooks #123

Closed
Snawoot opened this issue Feb 22, 2024 · 0 comments · Fixed by #124
Closed

Strange issue with OnEviction/OnInsertion hooks #123

Snawoot opened this issue Feb 22, 2024 · 0 comments · Fixed by #124
Labels

Comments

@Snawoot
Copy link
Contributor

Snawoot commented Feb 22, 2024

It seems under some circumstances single key can be present in cache twice, or at least have a duplicate in expiration queue.

It happens like this:

  1. Some keys get added to cache, some get updated to extend their TTL.
  2. I dump cache content periodically and see item will be valid, for example, for 10 more seconds.
  3. After, for example, 5 seconds OnEviction hook fires for that element.
  4. I prolong key for 10 more seconds immediately.
  5. Apparently some "lost" key gets prolonged and early OnEviction happens again even tho Item in cache is supposed to expire later.

It feels like in some place which works with expiration queue is not synchronized with storage update and/or duplicate item gets into expiration queue.

I'm using v3.1.1. Unfortunately, that's as much details I can provide, I triggered this issue only in prod environment and didn't managed to reproduce it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants