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

Aperta
#3,017 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, macos

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C
Stelle
45.8k
Fork
3.8k
Merge medio
2g 18h
PR unite (30g)
108

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DeusData/codebase-memory-mcp

Tutte le issue di DeusData/codebase-memory-mcp

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.