poteto-mode orch store: stale-lock takeover can delete a live lock and admit two writers
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- tooling
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 18.2k
- Forks
- 2k
- Merge médio
- 4h 20min
- PRs com merge (30d)
- 80
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cursor/plugins
-
pstack correct: a check behind an opt-in switch should count as unshipped until the switch is onAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
pstack: interrogate asks the user, which worker.md forbids for delegates that reach itTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
cursor/plugins#1272 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
poteto-mode: multi-phase-plan Merge placeholder still appends every PR to a base-branch stackTalvez já em andamento @mangeshraut712 assumiu há 15 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
typescript-best-practices: schema example uses z.string().uuid(), deprecated in Zod 4Talvez já em andamento @mangeshraut712 assumiu há 14 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
cursor/plugins#1165 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
statechart: relative-symlink launcher test fails on macOS because /var is a symlinkTalvez já em andamento @lnuxe assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
cursor/plugins#1164 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de cursor/plugins
Issues semelhantes
-
infra needs-triage
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 82/100
LucasSantana-Dev/Lucky#3331 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
kOaDT/oss-oopssec-store#381 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
nocobase/nocobase#11669 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
Area: API Bug Difficulty: Low Priority: Low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
Mantenedores costumam responder em até 1 dia