Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 1533 1609 +76
=========================================
+ Hits 1533 1609 +76 ☔ View full report in Codecov by Sentry. |
Adds a per-shard max_evict field (default usize::MAX) that bounds the number of entries evicted in a single try_evict call. A set_max_evict() public API is added, with 0 treated as 1 for safety. Co-Authored-By: DeepSeek V4 Pro <noreply@deepseek.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a per-try_evict eviction cap to LruLockMap, allowing callers to limit how many entries can be evicted during a single eviction pass while preserving the existing default behavior (unlimited).
Changes:
- Added a
max_evictlimit to each shard and enforced it insideLruShardInner::try_evict. - Introduced a new public API
LruLockMap::set_max_evict()to configure the limit across all shards. - Added unit tests covering default behavior, limited eviction, zero handling, in-use entries, and capacity shrinking scenarios.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: DeepSeek V4 Pro <noreply@deepseek.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
max_evictparameter to limit the number of entries evicted pertry_evictcallusize::MAX, fully backward compatible with existing behaviorset_max_evict()public API; a value of0is coerced to1Co-Authored-By: DeepSeek V4 Pro noreply@deepseek.com