poteto-mode orch store: stale-lock takeover can delete a live lock and admit two writers
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- tooling
调研方向
Start in scripts/orch/store.ts at acquireLock around :385-430, especially the EEXIST path and the unconditional unlink in takeOver at :394; also inspect --force handling. Reproduce the interleaving with the in-memory filesystem approach described, then design recovery serialization and a per-acquisition token checked by release and takeover. Done means the two-acquirer/one-stale-holder schedule admits at most one writer and the regression test asserts that.
由索引模型根据 Issue 内容生成。
描述
Found against pstack 0.15.34 at cursor/plugins 519d36aa98955bf680db01bcde5fdfba686dc901 (harness/pstack/claude-code/skills/poteto-mode/). Line numbers refer to that commit.
scripts/orch/store.ts (acquireLock, around :385-430) recovers a stale lock like this:
open(path, "wx")fails withEEXIST.- It reads the holder PID, and
holderIsDead(holder)is true. takeOver()callsunlink(path)unconditionally (:394), thencreate()again.
Between steps 2 and 3, another process can take over the same stale lock and create its own lock file. The slower
process then unlinks that new, live lock and creates its own. Both believe they hold the lock. The same applies to
--force (options.force). Every store write is a whole-file read-modify-write (unit updates, ledger records, gates,
standing orders), so two writers lose updates: units or verification records disappear.
Repro (executed in a no-write harness, using the transpiled acquireLock body over an in-memory filesystem):
A and B both fail create() with EEXIST and read the same dead holder PID.
A: unlink, create -> A holds the lock.
B resumes: unlink (deletes A's live lock), create -> B holds the lock too.
Suggested fix:
- Serialize recovery with a separate exclusive mechanism, such as an OS advisory lock (
flock) or a separate
wx-created recovery lock that is itself removed only by its creator. - Write a unique token with each acquisition (pid plus random nonce plus time), and have release and takeover check
that token instead of only the PID. - Rereading the holder just before the
unlinknarrows the window but doesn't close it. - Add a concurrency regression test for the schedule above: two acquirers, one stale holder, interleaved
read/unlink/create. Assert that at most one acquirer succeeds.
- 主要语言
- TypeScript
- 星标
- 18.2k
- 派生
- 2k
- 平均合并
- 3 小时 56 分钟
- 30 天内合并 PR
- 96
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cursor/plugins 的其他 Issue
-
pstack: interrogate asks the user, which worker.md forbids for delegates that reach it可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
poteto-mode: multi-phase-plan Merge placeholder still appends every PR to a base-branch stack可能已有人在做 @mangeshraut712 于 15 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
typescript-best-practices: schema example uses z.string().uuid(), deprecated in Zod 4可能已有人在做 @mangeshraut712 于 14 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
statechart: relative-symlink launcher test fails on macOS because /var is a symlink可能已有人在做 @lnuxe 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
pstack docs/harness/claude-code.md: transcript slug replaces every non-alphanumeric character, not only / and .可能已有人在做 @isTuhin 于 9 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
相似的 Issue
-
infra needs-triage
难度 2/5 1 小时以内 新手友好度 82/100
LucasSantana-Dev/Lucky#3331 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
kOaDT/oss-oopssec-store#381 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nocobase/nocobase#11669 · 1 条评论 ·
维护者通常 1 天内回复
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaude未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Area: API Bug Difficulty: Low Priority: Low
难度 2/5 1-3 小时 新手友好度 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
维护者通常 1 天内回复