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

Delete counters of qualified limits #399

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Delete counters of qualified limits #399

merged 3 commits into from
Jan 30, 2025

Conversation

alexsnaps
Copy link
Member

I don't think this is really a desirable fix to be honest... O(n) isn't really sustainable.
Probably resorting to a ordered collection and have all qualified counters for a qualified limit next to each other would be better... I'll see what I can do as part of #397

let l = limit.clone();
match self
.qualified_counters
.invalidate_entries_if(move |c, _| c.limit() == &l)
Copy link
Member Author

@alexsnaps alexsnaps Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether an entry actually needs invalidation will be checked for on the .get path by moka... so this isn't racy

@alexsnaps alexsnaps requested review from kuadrant-dev and removed request for adam-cattermole January 30, 2025 11:15
Copy link
Member

@adam-cattermole adam-cattermole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow review, I looked at it before and meant to get back to it

Signed-off-by: Alex Snaps <[email protected]>
@alexsnaps alexsnaps merged commit 066b218 into main Jan 30, 2025
10 checks passed
@alexsnaps alexsnaps deleted the qualified_deletes branch January 30, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants