Skip to content

fix(mcp): disconnect tracked browser on BrowserTracker.dispose#40967

Open
Skn0tt wants to merge 1 commit into
microsoft:mainfrom
Skn0tt:fix-mcp-browsertracker-leak
Open

fix(mcp): disconnect tracked browser on BrowserTracker.dispose#40967
Skn0tt wants to merge 1 commit into
microsoft:mainfrom
Skn0tt:fix-mcp-browsertracker-leak

Conversation

@Skn0tt
Copy link
Copy Markdown
Member

@Skn0tt Skn0tt commented May 22, 2026

Summary

  • BrowserTracker opens a remote Playwright connection to each bound daemon browser but never closes it on dispose, leaking the WS (and any client-driven subscriptions on it, e.g. screencast) until the dashboard process exits.
  • Adds a fire-and-forget browser.close() at the end of dispose().

Suspected contributor to the ~30s cli show --kill durations seen in MCP Windows Firefox CI jobs (e.g. https://github.com/microsoft/playwright/actions/runs/26235830215/job/77208610752), where the dashboard's gracefullyProcessExitDoNotHang 30s force-exit timer wins because cleanup didn't run.

The dashboard's BrowserTracker opens a remote Playwright connection to
each bound daemon browser but never closes it on dispose. The WS to the
daemon lingers until the dashboard process exits, keeping client-driven
subscriptions (e.g. screencast) alive on the daemon side longer than
they need to be.
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/launch.spec.ts:64 › persistent context @mcp-ubuntu-latest-chrome

7180 passed, 1113 skipped


Merge workflow run.

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.

1 participant