You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR Review: fix(cache): make in memory cache global. Summary: The PR makes the in-memory cache and in-flight map global singletons using OnceLock. The tracing improvements are clean. Issues: (1) Silent capacity mismatch in InMemoryDriver::new (driver.rs:147) - After the first call to InMemoryDriver::new(max_capacity), the max_capacity argument is silently ignored by subsequent calls since OnceLock::get_or_init is a no-op after initialization. Consider removing max_capacity entirely or asserting it matches on subsequent calls. (2) Test isolation risk - Both CACHE and IN_FLIGHT are process-level statics. Tests creating multiple InMemoryDriver or CacheInner instances share the same underlying state, so state from one test can leak into another. (3) Shared IN_FLIGHT across CacheInner instances (inner.rs:51) - If multiple CacheInner instances are created for different subsystems, they share the same in-flight map. A comment documenting this assumption would help future readers. Positives: Empty check before cache.driver.get() avoids a no-op round-trip; tracing improvements are cleaner; eviction listener is useful for observability. Minor: InMemoryDriver is now an empty struct and could be a ZST.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: