Skip to content

Fixes concurrent downloads of the same Yarn binary#764

Merged
arcanis merged 3 commits intomainfrom
mael/concurrent-corepack
Nov 7, 2025
Merged

Fixes concurrent downloads of the same Yarn binary#764
arcanis merged 3 commits intomainfrom
mael/concurrent-corepack

Conversation

@arcanis
Copy link
Copy Markdown
Contributor

@arcanis arcanis commented Nov 7, 2025

We had a check allowing the rename operation to fail for tarballs, but forgot to do the same for the single JS file downloaded in the Yarn codepath. As a result the operation could fail when two processes are downloading the exact same version. I got this error on Netlify when trying to install multiple git dependencies from the same repository.

Unfortunately no tests, as it's a race condition so not sure I can easily test that without making the tests flaky 🫤

@arcanis arcanis requested a review from aduh95 November 7, 2025 16:21
@arcanis arcanis force-pushed the mael/concurrent-corepack branch from b840767 to 321fdf0 Compare November 7, 2025 16:22
Comment thread sources/nodeUtils.ts
Comment thread sources/corepackUtils.ts Outdated
Comment thread sources/corepackUtils.ts Outdated
Comment thread sources/corepackUtils.ts
Comment thread sources/nodeUtils.ts Outdated
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@arcanis arcanis enabled auto-merge (squash) November 7, 2025 18:07
@arcanis arcanis merged commit 9d9cb3e into main Nov 7, 2025
9 checks passed
@arcanis arcanis deleted the mael/concurrent-corepack branch November 7, 2025 18:15
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.

2 participants