Skip to content

Fix bugs in Simple Cache#263

Merged
raakella1 merged 4 commits intoeBay:masterfrom
raakella1:simple_cache
Apr 21, 2025
Merged

Fix bugs in Simple Cache#263
raakella1 merged 4 commits intoeBay:masterfrom
raakella1:simple_cache

Conversation

@raakella1
Copy link
Contributor

@raakella1 raakella1 commented Mar 30, 2025

  • Fix the condition to evict keys in lru_evictor
  • Remove the key from hashmap after removing from the evictor.
  • Add a test case to trigger eviction using multiple threads.

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 76.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 60.79%. Comparing base (370c772) to head (816b94a).
Report is 27 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #263      +/-   ##
==========================================
- Coverage   64.29%   60.79%   -3.51%     
==========================================
  Files          72       74       +2     
  Lines        4406     4828     +422     
  Branches      555      654      +99     
==========================================
+ Hits         2833     2935     +102     
- Misses       1327     1634     +307     
- Partials      246      259      +13     
Components Coverage Δ
AuthManager 77.77% <ø> (ø)
Cache 37.45% <76.00%> (+7.51%) ⬆️
FDS 71.19% <100.00%> (+0.07%) ⬆️
FileWatcher 56.25% <ø> (ø)
Flip 65.34% <ø> (ø)
gRPC 76.04% <64.70%> (-1.01%) ⬇️
Logging 15.46% <3.69%> (-14.72%) ⬇️
Metrics 80.54% <ø> (+0.33%) ⬆️
Options 100.00% <ø> (ø)
Setting 56.79% <ø> (ø)
StatusObject 73.83% <ø> (ø)
Utility 83.47% <100.00%> (+0.75%) ⬆️
Version 95.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raakella1 raakella1 force-pushed the simple_cache branch 3 times, most recently from b3ff5d7 to d3ca31b Compare April 17, 2025 22:22
@raakella1
Copy link
Contributor Author

@yamingk I added more comments to the code at several places you suggested

@raakella1 raakella1 merged commit cf13542 into eBay:master Apr 21, 2025
5 checks passed
@raakella1 raakella1 deleted the simple_cache branch April 21, 2025 15:17
hkadayam pushed a commit to hkadayam/sisl that referenced this pull request May 9, 2025
* Fix bugs in Simple Cache

* use try_lock to delete the evicted entry from hashmap on a best effort basis

* fix bugs in the do_evict logic

* add commenst to explain the LRU cache functionality better

---------

Co-authored-by: Ravi Nagarjun Akella <raakella1@$HOSTNAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants