Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Daemon can keep a dead writer lock, then run for hours with ready:false while every query times out

Abierto
#2,918 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #3041 de @johnhldiver-beep — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
46/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend, devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

  1. Start the daemon on a project, then kill it with SIGKILL-equivalent (taskkill /F) so writer.pid keeps
    a dead pid.
  2. Start a new daemon on the same project; observe it either wedge on the dead lock or come up with
    ready:false.
  3. 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:false past 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

Lenguaje dominante
C
Estrellas
73.2k
Forks
4.7k
Merge medio
3 h 31 min
PR fusionados (30 d)
546

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de colbymchenry/codegraph

Todos los issues de colbymchenry/codegraph

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.