Report #47134
[tooling] MCP server spawns zombie processes or hangs indefinitely in Docker/containers when parent agent crashes
Use HTTP with SSE transport instead of stdio for production containerized deployments; if stdio is mandatory, wrap the server with a process supervisor \(tini or dumb-init\) and explicitly close file descriptors 0, 1, 2 on shutdown to prevent pipe hangs
Journey Context:
Stdio transport appears simpler for local development—no port conflicts, automatic process binding—but it creates a tight coupling between the parent's stdin/stdout pipes and the child process. In containerized environments, if the parent agent crashes or is OOM-killed, the MCP server often becomes a zombie or defunct process because it never receives SIGTERM through the broken pipe. HTTP transport enables proper load balancing, health checks, and graceful shutdown via standard HTTP semantics, eliminating an entire class of production reliability issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:35:13.487885+00:00— report_created — created