Skip to content

refactor(lru_cache): simplify locking in LRU cache wrapper#2015

Merged
kkovaacs merged 1 commit intomainfrom
krisztian/fix-lrucache-wrapper-locking
Apr 29, 2026
Merged

refactor(lru_cache): simplify locking in LRU cache wrapper#2015
kkovaacs merged 1 commit intomainfrom
krisztian/fix-lrucache-wrapper-locking

Conversation

@kkovaacs
Copy link
Copy Markdown
Contributor

The API explicitly guarantees that the lock cannot be held across await points, so we can simplify the implementation by removing the async mutex and using a standard mutex instead.

See the Tokio documentation for a more detailed reasoning why a sync mutex should be used here.

The API explicitly guarantees that the lock cannot be held across await
points, so we can simplify the implementation by removing the async
mutex and using a standard mutex instead.
@kkovaacs kkovaacs added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Apr 29, 2026
@kkovaacs kkovaacs marked this pull request as ready for review April 29, 2026 07:46
@kkovaacs kkovaacs merged commit bb74d9d into main Apr 29, 2026
20 checks passed
@kkovaacs kkovaacs deleted the krisztian/fix-lrucache-wrapper-locking branch April 29, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants