You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Launcher teardown leaves a descendant running when the launcher process exits first #1614
A locally launched HTTP/SSE upstream (command + url) whose launcher process backgrounds a long-lived descendant with redirected streams and then exits leaves that descendant running after mcpproxy tears the server down.
Where
internal/upstream/launcher/launcher.go, stopLocked: returns at once when Done is closed (the leader exited), so no signal reaches the rest of its process group.
internal/upstream/core/connection_launcher.go, watchLauncher: on leader exit after connect it calls Disconnect → stopLauncher → Stop, which is that no-op. The descendant becomes an orphan.
Reproduce
Server config: "command": "/bin/sh", "args": ["-c", "/usr/bin/python3 server.py PORT </dev/null >/dev/null 2>&1 &"], "url": "http://127.0.0.1:PORT/mcp". The instance connects (the backgrounded server answers), watchLauncher logs upstream child exited unexpectedly, disconnecting, and server.py keeps running in the old process group after the server is removed.
Observed on the Spec 116 PR4 branch (#1612) and on main.
Scope note
This is the ordinary teardown path, not retirement. PR #1612 (Spec 116 PR4, review round 2) makes the retirement kill (Handle.Kill) reach a descendant left in the group after the leader exited. It records the group at spawn and does not signal a group whose number was reused. Teardown was left unchanged to keep that PR in scope.
Suggested fix
After Stop, stopLauncher (and the connect-failure cleanups) could call handle.Kill(), which now has the reused-ID guard. Alternatively, decide that a launcher which daemonizes is unsupported and document it. The instance already disconnects when the leader exits.
Activity
test(upstream): fake handle proves launcher teardown Kills when Stop …
fix(upstream): hard-kill launcher group when Stop gives up (smart-mcp…