Daemon can keep a dead writer lock, then run for hours with ready:false while every query times out
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #3041 di @johnhldiver-beep — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 46/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start by tracing how the daemon creates and checks writer.pid, how it sets ready, and how MCP requests handle a writer that never becomes ready. Reproduce the dead-pid and live-but-not-ready cases on Windows using the issue’s steps, then inspect the relevant logs and tests. Done means stale locks are recoverable without spawning competing daemons, and clients receive a useful error identifying the lock and recorded pid.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
On Windows 11 with the MCP lane serving CodeGraph 1.6.2, codegraph_explore began timing out on one
project while the CLI still reported a version and the project was indexed (12,451 files).
The .codegraph directory contained:
writer.pid -> {"pid":58188,"mode":"fallback","startedAt":...,"ready":false} (pid 58188: not running)
Clearing that and reconnecting left a second state:
writer.pid -> {"pid":20632,"mode":"fallback","startedAt":...,"ready":false} (pid 20632: running, ~28 h)
The process was alive, had been up roughly 28 hours, and never reported ready:true. Every query against
that project timed out until the daemon was killed.
Why it is hard to recover from
- The dead-pid case is recoverable (
codegraph unlock, or deleting the stale artifacts). - The live but never-ready case is not: a pid-liveness check says "a writer owns this lock", so nothing
clears it, and the daemon keeps holding the project while answering nothing. - A client retry spawns another daemon against the same lock, which makes it worse.
Reproduction sketch
- Start the daemon on a project, then kill it with SIGKILL-equivalent (
taskkill /F) sowriter.pidkeeps
a dead pid. - Start a new daemon on the same project; observe it either wedge on the dead lock or come up with
ready:false. - Query over MCP: the request times out rather than returning an error that names the lock.
We did not reproduce this from a clean upstream install in isolation; it was observed on a lane build of
1.6.2 that also carries unrelated local patches, so the exact trigger may differ. The lock handling and the
ready flag are upstream behaviour.
What would fix it
Either of:
- Write the pid only after the writer is ready, or add an ownership token with a heartbeat/TTL so a
stale record is distinguishable from a live writer. - Treat
ready:falsepast a threshold as stale: clear the lock (and stop the owning daemon) when the
writer has not become ready for N minutes, and say so in the log. - At minimum, make the client failure name the lock file and the recorded pid instead of a bare timeout.
Environment
- CodeGraph 1.6.2, Windows 11, MCP lane (
npm-shim.js serve --mcp) - Project: a ~12k-file TypeScript monorepo
- Recovery that worked:
codegraph unlock, kill only the daemon process whose command line contains the
lane path, then one query
Tested upstream
CodeGraph 1.6.2, Windows 11, MCP lane, 2026-10-27; observed on a 12,451-file TS monorepo
- Lingua principale
- C
- Stelle
- 73.2k
- Fork
- 4.7k
- Merge medio
- 3h 31m
- PR unite (30g)
- 546
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 colbymchenry/codegraph
-
A `../` entry in package.json `workspaces` makes a folder outside the project count as a workspace package, and a call gets linked to the wrong functionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
colbymchenry/codegraph#3093 ·
I maintainer di solito rispondono entro 1 giorno
-
Windows: npm-shim spawnSync missing windowsHide flashes a console window on every MCP server launchAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
colbymchenry/codegraph#3054 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
colbymchenry/codegraph#2974 ·
I maintainer di solito rispondono entro 1 giorno
-
[Security Vulnerabiliy] Vulnerable bundled `node.exe` detected (Node2Shell - CVE-2026-111497)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
colbymchenry/codegraph#2959 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
codegraph ui - does not workAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
colbymchenry/codegraph#1900 · 2 commenti · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di colbymchenry/codegraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
elf_loader: Xtensa ignores the addend of R_XTENSA_GLOB_DAT / R_XTENSA_JMP_SLOT (C++ vtables)Forse già presa @diplfranzhoepfinger l’ha presa oggi. Apertaelf_loader
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
espressif/esp-iot-solution#813 ·
I maintainer di solito rispondono entro 1 giorno
-
Status: Opened Type: Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
msys2/MSYS2-packages#6919 ·
I maintainer di solito rispondono entro 1 giorno
-
severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
luainkernel/lunatik#2221 ·
I maintainer di solito rispondono entro 1 giorno