poteto-mode orch store: stale-lock takeover can delete a live lock and admit two writers
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 18.2k
- Fork
- 2k
- Merge medio
- 3h 56m
- PR unite (30g)
- 96
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cursor/plugins
-
pstack: interrogate asks the user, which worker.md forbids for delegates that reach itForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cursor/plugins#1272 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
poteto-mode: multi-phase-plan Merge placeholder still appends every PR to a base-branch stackForse già presa @mangeshraut712 l’ha presa 15 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
typescript-best-practices: schema example uses z.string().uuid(), deprecated in Zod 4Forse già presa @mangeshraut712 l’ha presa 14 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
cursor/plugins#1165 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
statechart: relative-symlink launcher test fails on macOS because /var is a symlinkForse già presa @lnuxe l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cursor/plugins#1164 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
pstack docs/harness/claude-code.md: transcript slug replaces every non-alphanumeric character, not only / and .Forse già presa @isTuhin l’ha presa 9 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
cursor/plugins#1155 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cursor/plugins
Issue simili
-
infra needs-triage
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
LucasSantana-Dev/Lucky#3331 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kOaDT/oss-oopssec-store#381 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nocobase/nocobase#11669 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Area: API Bug Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
I maintainer di solito rispondono entro 1 giorno