Add LRU capacity to ValidatingCache, remove sentinel pattern, add storage Update#4731
Add LRU capacity to ValidatingCache, remove sentinel pattern, add storage Update#4731
Conversation
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
jerm-dro
left a comment
There was a problem hiding this comment.
Some failing tests that seem minor.
I'm assuming there's no major changes here compared to the original, but LMK if that's not true
76455ef to
f917c29
Compare
f917c29 to
aecdae1
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4731 +/- ##
==========================================
+ Coverage 68.75% 68.86% +0.11%
==========================================
Files 518 517 -1
Lines 54826 54470 -356
==========================================
- Hits 37693 37512 -181
+ Misses 14239 14085 -154
+ Partials 2894 2873 -21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Summary
Re-applies the changes from #4669 which were reverted in #4730.
pkg/cache.ValidatingCache[K,V]: a fully-typed, capacity-bounded LRU cache using mutex+map+container/listterminatedSentinel/ sentinel+rollback patternDataStorage.Update(SET XX semantics) to close the TOCTOU resurrection windowFactoryConfig.CacheCapacityto wire the LRU limit throughsessionmanager.Newpkg/cache/validating_cache_test.goFixes #4494
Type of change
Test plan
task test)task lint-fix)🤖 Generated with Claude Code
Large PR Justification
This is the revert of an existing PR. Cannot be split.