-
Notifications
You must be signed in to change notification settings - Fork 767
[proxy] introduce moka for the project-info cache #12710
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
[proxy] introduce moka for the project-info cache #12710
Conversation
9031 tests run: 8381 passed, 0 failed, 650 skipped (full report)Flaky tests (3)Postgres 17
Postgres 16
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
ef1c66b at 2025-07-25T10:37:41.766Z :recycle: |
4ef15ef
to
5ded16f
Compare
5ded16f
to
f018e66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Some time ago we removed the |
Yeah, I'd like to reintroduce that - along with tracking how many items are in the caches. moka also lets you get notified when an item is removed so I think we can do something neat. Will make a follow up for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉
Problem
LKB-2502 The garbage collection of the project info cache is garbage.
What we observed: If we get unlucky, we might throw away a very hot entry if the cache is full. The GC loop is dependent on getting a lucky shard of the projects2ep table that clears a lot of cold entries. The GC does not take into account active use, and the interval it runs at is too sparse to do any good.
Can we switch to a proper cache implementation?
Complications:
retry_delay_ms
.Summary of changes
retry_delay_ms: Duration
withretry_at: Instant
when deserializing.moka
as a dependency, replacing ourTimedLru
.See the follow up PR for changing all TimedLru instances to use moka: #12726.