fix(daemon): on Linux a forward wall-clock step may make a live daemon's own lock read as stale

Abierto
#156 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, linux

Línea de trabajo

Start in internal/daemon/procstart_linux.go, where processStartTime combines btime from /proc/stat with the start tick from /proc/<pid>/stat, and check the lock and registry staleness comparison that uses procStartTimeSlack. First confirm the wall-clock step effect by reading btime before and after a 10 s forward step on Linux. Done means either a corroboration check against the start tick count for same-boot records, or a documented limit next to procStartTimeSlack, with the fix confirmed in the daemon tests.

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

Descripción

bug priority:low
What happens

On Linux, processStartTime (internal/daemon/procstart_linux.go) works out a process's start time when it reads it: btime from /proc/stat plus the tick count from /proc/<pid>/stat. The kernel computes btime from the current wall-clock offset, so a step of the wall clock moves it. Two examples of such a step are an NTP step and a WSL2 resume.

After a forward step of more than procStartTimeSlack (5 s), a live daemon's own lock and registry record would read as stale. Another acquire would then remove the lock (INDX-05), and List would prune the record.

This is unconfirmed: it comes from reading the code, not from a reproduction. The problem predates #146. The #146 change narrows it, because after a backward step the record now corroborates.

To confirm
  1. On Linux, read btime from /proc/stat.
  2. Step the wall clock forward 10 s.
  3. Read btime again and compare.
What should happen

If this is confirmed, corroborate a record from the same boot against a value that a clock step does not move, for example the start tick count. Otherwise, document the limit next to procStartTimeSlack.

Refs #146.


🤖 Generated with Claude Code

https://claude.ai/code/session_017tyHwvTWuHuKjdiZLTaGD1

Lenguaje dominante
Go
Estrellas
0
Forks
0
Merge medio
7 h 42 min
PR fusionados (30 d)
111

Preparar el entorno

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 seanb4t/codegraph-go

Todos los issues de seanb4t/codegraph-go

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.