release: 0.5.1 — concurrent commands stop failing on Windows - #5
Merged
Merged
Conversation
The only user-visible change since 0.5.0. Every command rebuilds registry.json after releasing the override lock, so two concurrent `describe` calls raced on that rename. Windows refuses to rename onto a file another process holds open, and the command reported failure for a write that had already succeeded — CI caught it on 2 of 12 runs before it was tracked down. This release is also the first to cut its own GitHub Release, so the repository page stops advertising a version three behind the one on npm. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.5.0 之后唯一的用户可见变化就是这一条 Windows 修复,所以是 patch 版。
修了什么
每条命令跑完都会重建
registry.json,而这一步在 override 锁释放之后。两个并发的describe就会撞在这一次 rename 上:POSIX 直接换 inode 永远成功;Windows 不允许 rename 到一个被别的进程打开着的文件。结果是写其实成功了,命令却报失败。近 12 次 CI 里挂过 2 次,属于长期存在的间歇性问题。
改法是有上限的短重试。没有加锁——
registry.json是可重建的缓存,真正不可重建的overrides.json早就有锁了。顺带
这是第一个会自己建 GitHub Release 的版本(#3 加的那一步)。0.3.0 / 0.4.0 / 0.5.0 三个标签当时都只推了标签没建 Release,导致仓库首页有三天挂着 0.2.0 当最新版。
验证
npm test98/98npm pack --dry-run:27 个文件 / 104.5 kB,与 0.5.0 同量级0.5.1小节实测抽出 12 行非空内容(抽不到会让发布步骤失败)🤖 Generated with Claude Code