macOS: daemon becomes unreachable after its lock files in /tmp are deleted and recreated

Abierto
#3,017 1 comentario 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
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, macos

Línea de trabajo

Start by tracing how the daemon chooses its runtime directory and creates or checks lock files, then inspect the client path that handles a free lock when the socket is already occupied. The report reproduces the failure on macOS and suggests moving the default runtime directory outside /tmp or detecting the live socket. Done means new clients can reach the existing daemon after /tmp cleanup, or the default directory avoids that cleanup.

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

Descripción

bug stability/performance

Version: 0.10.8 (npm, macOS, Apple Silicon)

What happens

After the account daemon has been running for a few days, every new client fails with:

codebase-memory-mcp: CBM daemon could not start within 30000 ms

Clients that connected earlier keep working. The old daemon is still running and still listens on its socket.

Cause (observed)

The daemon keeps its locks in /private/tmp/cbm-daemon-<uid>/. In my case:

  • The daemon started on day 0 and holds locks on the original lock files (inodes 457353xx).
  • About 4.5 days later, the lock files exist with new inodes (487612xx). The socket file is still the original one.
  • A new client locks the new files, finds them free (version_cohort.claimed_unheld), concludes no daemon runs and tries to start one. That fails because the old daemon still owns the socket, so the client times out.

I have not confirmed what deleted the lock files. macOS cleans /tmp of files that have not been accessed for a while, and the empty lock files are never read, so they qualify.

Workaround

Set CBM_RUNTIME_DIR to a folder outside /tmp, for example ~/.cache/codebase-memory-mcp/run, and restart the daemon.

Suggested fix

  • On macOS, put the default runtime folder outside /tmp, for example under CBM_CACHE_DIR or ~/Library/Caches.
  • Or let a client detect this state: the lock is free, but the socket answers. The client could then connect instead of starting a second daemon, or tell the old daemon to restart.
Lenguaje dominante
C
Estrellas
45.8k
Forks
3.8k
Merge medio
2 d 18 h
PR fusionados (30 d)
108

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 DeusData/codebase-memory-mcp

Todos los issues de DeusData/codebase-memory-mcp

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.