Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Oct 2, 2023

Calling Clear() with BackgroundThreadScheduler can result in a situation where window/probation/protected contains an item that was already removed. Since the clear logic trims n items, where n == cache.Count, the already removed items pollute the list of candidates resulting in non-removed items remaining in the cache.

@bitfaster bitfaster linked an issue Oct 2, 2023 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Oct 2, 2023

Coverage Status

coverage: 97.121% (-0.06%) from 97.185% when pulling 8a27bbf on users/alexpeck/lfuclear into 1e7741f on main.

@bitfaster bitfaster marked this pull request as ready for review October 2, 2023 18:35
@bitfaster bitfaster merged commit 822e160 into main Oct 2, 2023
@bitfaster bitfaster deleted the users/alexpeck/lfuclear branch October 2, 2023 18:38
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.

Clearing LFU cache doesn't actually clear it

3 participants