Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fixes a deadlock when evicting cached descriptions #4119

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

baywet
Copy link
Member

@baywet baywet commented Feb 2, 2024

follow up to #4046 CC @MarkCiliaVincenti

@baywet baywet requested a review from a team as a code owner February 2, 2024 15:31
@baywet baywet self-assigned this Feb 2, 2024
@baywet baywet enabled auto-merge February 2, 2024 15:31
Signed-off-by: Vincent Biret <[email protected]>
@baywet
Copy link
Member Author

baywet commented Feb 2, 2024

@MarkCiliaVincenti this bug was revealed by the recent change. The previous library guarded against re-entrant calls. It'd be nice to have the same feature in this new library.

Copy link

sonarqubecloud bot commented Feb 2, 2024

auto-merge was automatically disabled February 2, 2024 15:37

Pull Request is not mergeable

@MarkCiliaVincenti
Copy link
Contributor

MarkCiliaVincenti commented Feb 2, 2024

@MarkCiliaVincenti this bug was revealed by the recent change. The previous library guarded against re-entrant calls. It'd be nice to have the same feature in this new library.

Lock re-entrancy and asynchronous code do not mix well. Some call it impossible (to get perfect) https://itnext.io/reentrant-recursive-async-lock-is-impossible-in-c-e9593f4aa38a

And Stephen Cleary also recommends refactoring to avoid it. https://blog.stephencleary.com/2013/04/recursive-re-entrant-locks.html

I should have made this behaviour clear in my description and also in my documentation. Something to work on this weekend perhaps.

Apologies for causing this issue.

@baywet baywet enabled auto-merge February 2, 2024 19:41
@baywet
Copy link
Member Author

baywet commented Feb 2, 2024

no worries, nothing major, we'll roll out a patch once this is merged.
I looped you in the fix in case you could improve your library (either through docs, or through changes), that's it. I understand that tracking re-entrances is complex to implement/costly at best.

@baywet baywet merged commit 1bb37db into main Feb 5, 2024
185 of 186 checks passed
@baywet baywet deleted the bugfix/caching-dead-lock branch February 5, 2024 06:32
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.

3 participants