fix(daemon): daemon stop reports a failed stop for a daemon that exits just before SIGTERM
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza en internal/daemon/stop.go, en stopTargets, donde el error de stopSignal se añade al error unido. El emisor POSIX es sendStop en internal/daemon/stop_posix.go. Decide si un resultado os.ErrProcessDone cuenta como detenido o se omite, y luego gestiónalo con errors.Is. Está listo cuando una prueba que inyecta os.ErrProcessDone a través de la costura stopSignal muestra que daemon stop no devuelve ningún error.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
stopTargets (internal/daemon/stop.go) checks each record with isStale, and then sends SIGTERM through stopSignal. On POSIX that is sendStop (internal/daemon/stop_posix.go): os.FindProcess(pid), then proc.Signal(syscall.SIGTERM).
A daemon can exit between the isStale check and the signal. proc.Signal then returns os.ErrProcessDone ("os: process already finished"), and stopTargets adds it to the joined error:
if err := stopSignal(rec.PID); err != nil {
errs = append(errs, fmt.Errorf("stopping pid %d: %w", rec.PID, err))
continue
}
So codegraph daemon stop exits 1 with stopping pid N: os: process already finished, although the daemon is gone, which is what the user asked for. With #179, a stop that stopped nothing and failed prints nothing on stdout, so the user sees only that error.
Evidence
- A scratch program in the suite review of #179 showed that SIGTERM to an exited pid returns
os.ErrProcessDone. - The race was not reproduced through the command itself. The window between
isStaleand the signal is short.
Possible direction
- In
stopTargets, handleerrors.Is(err, os.ErrProcessDone)without adding an error. - Decide whether such a record counts as stopped (the process is gone, so
stopped pid Nis true) or is skipped like a stale record. - Add a test through the
stopSignalseam that returnsos.ErrProcessDone.
Found by the silent-failure reviewer in the suite review of #179 (finding QUAL-4, PLAUSIBLE). The code predates #179.
🤖 Generated with Claude Code
- Lenguaje dominante
- Go
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 7 h 42 min
- PR fusionados (30 d)
- 111
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 seanb4t/codegraph-go
-
chore needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
seanb4t/codegraph-go#380 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
seanb4t/codegraph-go#379 ·
Los mantenedores suelen responder en 1 día
-
area:query chore needs-triage spec-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
seanb4t/codegraph-go#377 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
seanb4t/codegraph-go#362 ·
Los mantenedores suelen responder en 1 día
-
area:query bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
seanb4t/codegraph-go#355 ·
Los mantenedores suelen responder en 1 día
Todos los issues de seanb4t/codegraph-go
Issues similares
-
Add iterate GmbH domains to a dedicated list and include it in company and developer categoriesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
v2fly/domain-list-community#4307 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mattabate/life-distributable#232 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día