Skip to content

Conversation

@deepak1556
Copy link
Collaborator

Fixes #291346

With migration to render process reuse, our native-watchdog in the extension host cannot help with shutdown down of long running process on workbench reload. Instead we now rely on the main process to kill the extension host when the associated window is closed or reloaded.

@deepak1556 deepak1556 added this to the February 2026 milestone Feb 3, 2026
@deepak1556 deepak1556 requested a review from alexdima February 3, 2026 20:33
@deepak1556 deepak1556 self-assigned this Feb 3, 2026
Copilot AI review requested due to automatic review settings February 3, 2026 20:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ties the Electron (main process) extension host utility process lifecycle to the owning window so that window reload/close reliably terminates long-running/blocked extension host processes, addressing #291346.

Changes:

  • Bind extension host utility processes to the window lifecycle via windowLifecycleBound: true in the Electron main extension host starter.
  • Add a new smoke test that blocks the extension host, reloads the window, and verifies the old extension host PID is terminated.
  • Add a dedicated smoke test extension used by the new restart test and wire it into the smoke test runner.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vs/platform/extensions/electron-main/extensionHostStarter.ts Binds the extension host utility process lifecycle to the owning window so reload/close kills it.
test/smoke/src/main.ts Copies the new smoke-test extension into the test extensions dir and registers the new restart suite.
test/smoke/src/areas/extensions/extension-host-restart.test.ts Adds a smoke test that blocks the extension host, reloads the window, and asserts the old PID is gone.
test/smoke/extensions/vscode-smoketest-ext-host/package.json Declares the new smoke-test extension that exposes a command used to block the extension host.
test/smoke/extensions/vscode-smoketest-ext-host/extension.js Implements the command to record the extension host PID and block execution.

@deepak1556 deepak1556 force-pushed the robo/refactor_ext_host_exit branch 2 times, most recently from 83d242d to 367250d Compare February 4, 2026 05:45
alexdima
alexdima previously approved these changes Feb 4, 2026
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I just left a comment about the graceful 5s behavior we used to have

@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/platform/utilityProcess/electron-main/utilityProcess.ts

@deepak1556 deepak1556 enabled auto-merge (squash) February 4, 2026 10:25
@deepak1556 deepak1556 merged commit b22bccf into main Feb 4, 2026
22 checks passed
@deepak1556 deepak1556 deleted the robo/refactor_ext_host_exit branch February 4, 2026 10:42
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.

Extension Host processes don't quit after window reload

4 participants