Investigation: cannot reproduce orphan Chrome trees from @playwright/mcp on Ubuntu/Node 22#41017
Draft
Copilot wants to merge 1 commit into
Draft
Investigation: cannot reproduce orphan Chrome trees from @playwright/mcp on Ubuntu/Node 22#41017Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #41013 reports that
@playwright/mcpleaves Chrome process trees re-parented to PID 1 when the MCP host is SIGKILL'd, attributing it to (a)npxswallowing stdin-close propagation and (b) gaps in the watchdog atpackages/playwright-core/src/tools/mcp/watchdog.ts.No code changes. This PR is the investigation record for the reply on the issue.
Findings
host.mjstwice against@playwright/mcp@latest(resolved to1.61.0-alpha-1778188671000). Full spawn chainnode → npm exec → sh → node(mcp) → chrome (+ zygote/gpu/network/storage/renderers)exited within 4s ofkill -KILL <host>. Zero orphans, both runs.npxswallows stdin-close" claim — minimal child wrapped vianpx -yloggingstdinevents. On host SIGKILL both'end'and'close'fired through the fullnpx → npm exec → sh → nodechain, which is exactly whatwatchdog.tslistens 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 -pof the live chain, whether the MCP servernodealso survives or onlychrome(distinguishes "watchdog never fires" from "watchdog fires but the 15sprocess.exit(0)orphans chrome"), captured MCP stderr to see thetestDebug('gracefully closing …')line, and whether the repro persists without thenpxintermediary.