Skip to content

fix(client): serialize daemon startup across processes - #243

Open
fml09 wants to merge 1 commit into
cocoindex-io:mainfrom
fml09:fix/serialize-daemon-startup
Open

fix(client): serialize daemon startup across processes#243
fml09 wants to merge 1 commit into
cocoindex-io:mainfrom
fml09:fix/serialize-daemon-startup

Conversation

@fml09

@fml09 fml09 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • serialize automatic daemon startup across processes with a file lock
  • retry the handshake after lock acquisition so waiting clients reuse the running daemon
  • increase the IPC listener backlog for simultaneous MCP clients

Root cause

Startup coordination was process-local. Concurrent MCP clients could each miss the handshake, spawn a daemon, and race over the same PID and socket paths, leaving duplicate processes behind.

Validation

  • six-process regression: six launches before, one after
  • uv run pytest — 270 passed
  • uv run prek run --all-files — passed

@fml09
fml09 marked this pull request as ready for review July 30, 2026 04:43
@fml09
fml09 marked this pull request as draft July 30, 2026 04:47
@fml09
fml09 marked this pull request as ready for review July 30, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant