poteto-mode orch store: stale-lock takeover can delete a live lock and admit two writers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 18.2k
- Forks
- 2k
- Merge medio
- 3 h 56 min
- PR fusionados (30 d)
- 96
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cursor/plugins
-
pstack: interrogate asks the user, which worker.md forbids for delegates that reach itPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
cursor/plugins#1272 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
poteto-mode: multi-phase-plan Merge placeholder still appends every PR to a base-branch stackPosiblemente ocupada @mangeshraut712 la tomó hace 15 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
typescript-best-practices: schema example uses z.string().uuid(), deprecated in Zod 4Posiblemente ocupada @mangeshraut712 la tomó hace 14 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
cursor/plugins#1165 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
statechart: relative-symlink launcher test fails on macOS because /var is a symlinkPosiblemente ocupada @lnuxe la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cursor/plugins#1164 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
pstack docs/harness/claude-code.md: transcript slug replaces every non-alphanumeric character, not only / and .Posiblemente ocupada @isTuhin la tomó hace 9 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
cursor/plugins#1155 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de cursor/plugins
Issues similares
-
infra needs-triage
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
LucasSantana-Dev/Lucky#3331 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kOaDT/oss-oopssec-store#381 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nocobase/nocobase#11669 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Area: API Bug Difficulty: Low Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
Los mantenedores suelen responder en 1 día