Skip to content

fix(install): avoid truncating lock file to prevent sharing violation on Windows#1467

Merged
fengmk2 merged 10 commits intovoidzero-dev:mainfrom
rorychatt:fix/windows-lock-concurrency
Apr 27, 2026
Merged

fix(install): avoid truncating lock file to prevent sharing violation on Windows#1467
fengmk2 merged 10 commits intovoidzero-dev:mainfrom
rorychatt:fix/windows-lock-concurrency

Conversation

@rorychatt
Copy link
Copy Markdown
Contributor

@rorychatt rorychatt commented Apr 24, 2026

Fixes #1465

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit ce43480
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69ef4c18f130de000813d984

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 25, 2026

@codex review

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 25, 2026

@rorychatt Could you add a corresponding test? Unit tests or snap tests are both fine.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rorychatt
Copy link
Copy Markdown
Contributor Author

@fengmk2 sure. I will get back to you in the evening.

@rorychatt rorychatt force-pushed the fix/windows-lock-concurrency branch from 7925c93 to 31b8a9d Compare April 25, 2026 19:29
@rorychatt
Copy link
Copy Markdown
Contributor Author

rorychatt commented Apr 25, 2026

To get absolute proof, I wrote a dedicated cross-process test script locally that spawns a child process to exclusively lock the file, while the parent process attempts to open it simultaneously

When the parent process used the old File::create logic, it crashed with ERROR_SHARING_VIOLATION, perfectly reproducing the bug.

When I switched the parent process to use our extracted OpenOptions fix, it cleanly opened the handle and waited in line for the lock without any errors, proving the fix works flawlessly

Because standard cargo test runs in a single process, the unit test I added serves to verify the syntactic correctness of the extracted open_lock_file function and ensures it successfully acquires and releases the lock

@fengmk2

@rorychatt
Copy link
Copy Markdown
Contributor Author

@fengmk2 Sorry, I removed the unused import. Linting should pass now

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 26, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

@rorychatt Thanks!

@fengmk2 fengmk2 merged commit 2531a31 into voidzero-dev:main Apr 27, 2026
38 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.

Concurrency issue: Running vp install in parallel across multiple directories fails on Windows

2 participants