Files
pnpm/fs
Zoltan Kochan cbfeeef328 fix: avoid partial package materialization under concurrent installs (#12204)
* fix(importer): avoid partial package materialization under concurrent installs

The fast import path destructively emptied the shared virtual-store
directory before writing files directly into it. When multiple pnpm
installs ran against the same workspace concurrently, one importer could
wipe files another had already written; if the survivors included the
package.json completion marker, every later install treated the broken
directory as complete and never repaired it.

The regular path now imports directly only when it can create the target
directory exclusively (proving no concurrent importer), and otherwise
builds the package in a private temp dir and atomically renames it into
place.

Close #12197

* fix(importer): clean up exclusively-created dir on failed import

When the auto importer probes clone then falls back to hardlink/copy, the
failed clone attempt left an empty exclusively-created directory behind, so
the retry saw EEXIST and diverted to the staging path instead of writing
directly. Since the directory was created exclusively (no other process
writes into it), remove the partial result on failure so subsequent
same-process method fallbacks can fast-path again.
2026-06-05 01:55:13 +02:00
..
2026-04-30 23:03:46 +02:00
2026-04-30 23:03:46 +02:00
2026-05-09 02:06:35 +02:00
2026-04-30 23:03:46 +02:00