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

fix: concurrency deadlock #1980

Merged
merged 2 commits into from
Mar 6, 2024
Merged

fix: concurrency deadlock #1980

merged 2 commits into from
Mar 6, 2024

Conversation

ematipico
Copy link
Member

Summary

To fix the deadlock, I created two functions get/set to manage the IndexSet<DocumentFileSource> list. By doing so, we reduce the "window" of when the lock is actually owned by a thread. In the function get_parse, we were actually trying to lock the same resource multiple times without releasing them.

By using two small functions, the lock is released when the scope of the function ends, making it safer.

Test Plan

I run our internal pnpm check multiple time and now there's not deadlock

@github-actions github-actions bot added the A-Project Area: project label Mar 6, 2024
Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for biomejs canceled.

Name Link
🔨 Latest commit 7677479
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65e87cda70dabb0008267454

@ematipico ematipico requested review from a team March 6, 2024 13:37
@ematipico ematipico merged commit f9519bf into main Mar 6, 2024
18 checks passed
@ematipico ematipico deleted the fix/concurrency-deadlock branch March 6, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants