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 race condition between instances of svm in setting up the SVM directory #96

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

nategraf
Copy link
Contributor

When running Foundry in CI, I encountered an issue where if multiple instances of Foundry were launched at the same time, compiling Solidity source in different directories, one would sometimes fail with an AlreadyExists error.

Upon investigating, I noticed that there is indeed a file lock to prevent multiple solc versions from being installed at the same time, but that this file lock does not apply to creating the SVM directory.
This PR adds error hanlding to the setup_data_dir function to handle a race condition to create the SVM directory.

Copy link
Collaborator

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this happen in CIs already—supportive

crates/svm-rs/src/lib.rs Outdated Show resolved Hide resolved
@Evalir Evalir requested a review from mattsse October 21, 2023 12:30
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm,

@mattsse mattsse merged commit aeed327 into alloy-rs:master Nov 8, 2023
5 checks passed
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