Concurrent first runs of `vp config` in linked worktrees fail with "could not lock config file"
维护者通常 1 天内回复
@naokihaba 已经在做这个了。
开始于 2026年10月9日。
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
This is a follow-up to #2849.
While prevents vp config from rewriting git config values that are already up to date, the very first run in a fresh clone still has to write them because core.hooksPath, vp.hooks.dir, and vp.hooks.prefix are not set yet.
Linked worktrees share the same .git/config file. Because git fails immediately instead of waiting when config.lock exists, running the initial vp config concurrently across multiple worktrees causes write collisions:
error: could not lock config file /path/to/repo/.git/config: File exists
The command then exits with code 1. If this runs inside a prepare script, the package manager treats it as a lifecycle script failure and aborts the install.
We run into this when setting up multiple worktrees in parallel right after cloning, before any single worktree finishes its setup. Once one command succeeds, subsequent runs simply skip writing and never fail.
Reproduction
https://github.com/naokihaba/vite-plus-config-first-run-lock-repro
Steps to reproduce
1. Clone the reproduction repository and install the dependencies.
git clone https://github.com/naokihaba/vite-plus-config-first-run-lock-repro
cd vite-plus-config-first-run-lock-repro
pnpm install --ignore-scripts
2. Run the reproduction with two worktrees.
pnpm repro
3. You can also run it with four worktrees or use the global CLI if needed.
REPRO_WORKTREES=4 REPRO_ROUNDS=15 bash reproduce.sh
bash reproduce.sh --global
In each round, the script creates a fresh repository with linked worktrees and runs `vp config --no-agent` across all of them at once, so every command acts as a first run.
If at least one lock failure occurs, the script prints a summary and exits with code 0.
System Info
$ vp env current
Node.js:
Version 24.21.0
Source lts
Bin Path /Users/naokihaba/.vite-plus/js_runtime/node/24.21.0/bin/node
Installed true
Mode managed
Package Manager:
Name pnpm
Version 12.10.1
Source lockfile or config
Bin Paths
pnpm /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpm
pnpx /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpx
Installed false
Mode managed
$ vp --version
vp v1.0.0
Local vite-plus:
vite-plus v1.0.0
Tools:
vite v8.3.1
rolldown v1.2.11
vitest v5.0.1
oxfmt v0.70.0
oxlint v1.85.0
oxlint-tsgolint v7.0.2003
tsdown v0.23.0
Environment:
Package manager pnpm default
Node.js v24.21.0
# Additional
git version 2.55.0
macOS 27.0 (arm64)
Node.js v24.20.0 from PATH for the local-mode runs
Used Package Manager
pnpm
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- 主要语言
- Rust
- 星标
- 6k
- 派生
- 274
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 206
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/vite-plus 的其他 Issue
-
pending triage
难度 2/5 1-3 小时 新手友好度 72/100
voidzero-dev/vite-plus#2882 · 2 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
voidzero-dev/vite-plus#2097 · 10 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
`vp dev` does not print "ready in N ms"可能已有人在做 @fengmk2 今天认领。 未关闭bug
voidzero-dev/vite-plus#3053 · 已指派 1 人 ·
维护者通常 1 天内回复
-
the `vp migrate` command wrongly rewrite "vite/rolldown/plugins" to "vite-plus/rolldown/plugins"未关闭pending triage
难度 3/5 1-2 天 新手友好度 55/100
voidzero-dev/vite-plus#3050 ·
维护者通常 1 天内回复
-
vp migrate crashes with "Undefined meta var" when a migrated config string contains `$`可能已有人在做 @BenjyLimmy 今天认领。 未关闭bug
voidzero-dev/vite-plus#3045 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 voidzero-dev/vite-plus 的全部 Issue
相似的 Issue
-
RUSTSEC-2026-0348: Brotli certificate decompression can allocate up to 1 GiB before authentication未关闭
难度 2/5 1-3 小时 新手友好度 60/100
-
难度 1/5 1-3 小时 新手友好度 62/100
-
core: Amount::from_str panics on values above 21M BTC instead of returning an error可能已有人在做 @bhuvan-somisetty 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
crate: spate-s3
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
write_iceberg ignores the table's write.parquet.compression-codec property可能已有人在做 @YuangGao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Eventual-Inc/Daft#7606 ·
维护者通常 1 天内回复