Skip to content

Investigation: cannot reproduce orphan Chrome trees from @playwright/mcp on Ubuntu/Node 22#41017

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/bug-fix-orphans-chrome-process
Draft

Investigation: cannot reproduce orphan Chrome trees from @playwright/mcp on Ubuntu/Node 22#41017
Copilot wants to merge 1 commit into
mainfrom
copilot/bug-fix-orphans-chrome-process

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

Issue #41013 reports that @playwright/mcp leaves Chrome process trees re-parented to PID 1 when the MCP host is SIGKILL'd, attributing it to (a) npx swallowing stdin-close propagation and (b) gaps in the watchdog at packages/playwright-core/src/tools/mcp/watchdog.ts.

No code changes. This PR is the investigation record for the reply on the issue.

Findings

  • OP's repro on Ubuntu 24.04.4 / Node 22.22.3 / npm 10.9.8 — ran host.mjs twice against @playwright/mcp@latest (resolved to 1.61.0-alpha-1778188671000). Full spawn chain node → npm exec → sh → node(mcp) → chrome (+ zygote/gpu/network/storage/renderers) exited within 4s of kill -KILL <host>. Zero orphans, both runs.
  • Direct test of the "npx swallows stdin-close" claim — minimal child wrapped via npx -y logging stdin events. On host SIGKILL both 'end' and 'close' fired through the full npx → npm exec → sh → node chain, which is exactly what watchdog.ts listens on. No upstream npm/cli or nodejs/node issue found to back the swallowing claim; it appears to originate from the linked playwright-mcp threads.

Outcome

Posted a reply on #41013 asking OP for the discriminating diagnostics needed before any code change is justified: pstree -p of the live chain, whether the MCP server node also survives or only chrome (distinguishes "watchdog never fires" from "watchdog fires but the 15s process.exit(0) orphans chrome"), captured MCP stderr to see the testDebug('gracefully closing …') line, and whether the repro persists without the npx intermediary.

Copilot AI changed the title [WIP] Fix Chrome process orphaning issue when MCP host dies Investigation: cannot reproduce orphan Chrome trees from @playwright/mcp on Ubuntu/Node 22 May 27, 2026
Copilot finished work on behalf of Skn0tt May 27, 2026 08:22
Copilot AI requested a review from Skn0tt May 27, 2026 08:22
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.

[Bug]: @playwright/mcp orphans Chrome process trees when the MCP host dies without SIGINT/SIGTERM

2 participants