Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a concurrency-safe mechanism for downloading and installing package managers by introducing per-directory locks to prevent race conditions when multiple threads attempt to install the same package manager version simultaneously.
- Adds a
get_directory_lockfunction that maintains a global map of per-directory locks usingOnceLockandArc<TokioMutex<()>> - Protects the critical section where directories are removed and renamed with an async lock
- Enhances the file existence check after lock acquisition to verify all required shim files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
19076a6 to
2888f33
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
https://github.com/voidzero-dev/vite-plus/runs/54331917061 Let's set |
2888f33 to
7ddf40b
Compare
7ddf40b to
d14a57a
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
https://github.com/voidzero-dev/vite-plus/actions/runs/19028678443/job/54337451055 The issue is still caused by concurrent deletions of the same directory. Snap-test is a multi-process operation, so thread locks cannot resolve concurrency conflicts and need to be changed to file locks. |
d14a57a to
201a5aa
Compare
201a5aa to
c5cd576
Compare
9f4372e to
a73f6bc
Compare
a73f6bc to
ca1cfa3
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ca1cfa3 to
1d5153a
Compare
1d5153a to
41df960
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
41df960 to
0c1be78
Compare
0c1be78 to
57e4322
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
57e4322 to
3d1aecf
Compare
|
Run it a few more times today; if no errors occur, it can be merged. |
3d1aecf to
c6a415b
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c6a415b to
c91191b
Compare
|
@branchseer Can you take another look? I retried enough times today and the directory error hasn't reappeared |



Add file locking to prevent race conditions in package manager installation
Added file-based locking to ensure atomic operations during package manager downloads, preventing concurrent processes from conflicting when installing the same package manager version.
close #140
Changes
fs4crate to synchronize critical operationsremove_dir_all_forceto provide better debugging informationRUST_BACKTRACE=1to CLI E2E tests for better error diagnosticsRUST_*to passthrough environment variables in tools utilsWhy
This change prevents race conditions when multiple processes attempt to install the same package manager version simultaneously. The file lock ensures that the remove and rename operations are performed atomically, avoiding conflicts between concurrent installation attempts.