v6.2.2
Fix: Orphan Process CPU Spin
Problem: 12+ orphaned server instances consuming 80-100% CPU each (~1000% total), running for hours. Root cause: Claude Code uses unix domain sockets for stdin/stdout. When the parent dies, Node.js does NOT emit end/close on broken unix sockets — so the existing health check never triggered.
Fixes:
- Parent PID detection — captures
process.ppidat startup; when parent dies, OS reparents to PID 1, detected every 2 seconds - Stdout EPIPE probe — writes empty string to stdout each cycle; broken socket triggers EPIPE → shutdown
- pgrep-based multi-instance cleanup — on startup, kills ALL stale server processes (not just one PID from lock file)
Added:
- Orphan Prevention E2E test suite (
npm run test:e2e:orphan) — 4 tests run in CI on every push:- Server exits when parent disconnects
- New instance kills previous instances
- No CPU spin on idle server
- No orphan processes remain
Full Changelog: v6.2.1...v6.2.2
📦 Installation
npm install google-researcher-mcp@6.2.2