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

オープン
#3,017 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, macos

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
C
スター
45.8k
フォーク
3.8k
平均マージ
2日 18時間
マージ済み PR(30日)
108

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeusData/codebase-memory-mcp のほかの issue

DeusData/codebase-memory-mcp の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。