Repository navigation
fix(mcp): do not close the browser twice when the client disconnects - #43174
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
On stdin end, the MCP server closed its transport, which closed the browser, and the exit watchdog closed the browser at the same time. The second close force-killed the browser. Remove the 'end' handler, so the watchdog is the only shutdown path. The 'end' handler also killed a pending browser_annotate client. That client now notices the exit of its parent by itself: it reads stdin, so the 'close' event fires. Fixes: microsoft#43098
6ac86ae to
cd7ddeb
Compare
d6158cd
into
microsoft:main
Test results for "MCP"1 failed 9047 passed, 1495 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the latest CI run. 🟢 The remaining failure is a confirmed pre-existing flakeThe PR is clear. The exact Windows Firefox test has failed on several unrelated PRs, before this change. DetailsOverall assessment This PR changes shutdown after stdin disconnect and parent-process exit. The failing test keeps the MCP client connected and instead waits for the existing 500 ms browser idle timer, so those changed shutdown paths are not active. Its relaunch raced a browser close and returned Pre-existing flake / infra
Triaged by the Playwright bot - agent run |
…e client disconnects
Summary
'end'handler, so the watchdog is the only shutdown path.'end'handler also killed a pendingbrowser_annotateclient. That client now notices the exit of its parent by itself: it reads stdin, so the'close'event fires.Fixes #43098