Skip to content

fix: wire ext host restart through utility process api#302633

Open
deepak1556 wants to merge 1 commit intomainfrom
robo/fix_ext_host_restart
Open

fix: wire ext host restart through utility process api#302633
deepak1556 wants to merge 1 commit intomainfrom
robo/fix_ext_host_restart

Conversation

@deepak1556
Copy link
Collaborator

Fixes #296681

Followup to #293144 covering extension host restart path

@deepak1556 deepak1556 added this to the 1.113.0 milestone Mar 18, 2026
@deepak1556 deepak1556 self-assigned this Mar 18, 2026
@deepak1556 deepak1556 requested review from alexdima and Copilot March 18, 2026 02:42
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 fixes the extension host restart path so that a blocked/unresponsive extension host is properly terminated via the utility process API, addressing the “rogue Code Helper (Plugin)” process reported in #296681.

Changes:

  • Add a main-process waitForExit capability to the extension host starter and plumb a shared grace-time constant.
  • Implement a local extension host disconnect() that requests graceful termination and then waits (with grace time) for the process to exit.
  • Extend smoke coverage to validate that restarting the extension host replaces the PID and terminates the old process.

Reviewed changes

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

Show a summary per file
File Description
test/smoke/src/areas/extensions/extension-host-restart.test.ts Adds a smoke test that restarts the extension host and verifies old PID termination + new PID observed.
test/smoke/extensions/vscode-smoketest-ext-host/extension.js Writes an “activation PID” marker on activation to support restart validation in smoke tests.
src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts Adds disconnect() for local ext host that sends terminate and waits for utility-process exit; tweaks dispose behavior.
src/vs/platform/extensions/electron-main/extensionHostStarter.ts Implements waitForExit() and uses shared grace-time constant for window lifecycle binding.
src/vs/platform/extensions/common/extensionHostStarter.ts Introduces extensionHostGraceTimeMs and adds waitForExit to the starter interface.

You can also share your feedback on Copilot code review. Take the survey.

@deepak1556 deepak1556 force-pushed the robo/fix_ext_host_restart branch from 7a952c1 to 3435c28 Compare March 18, 2026 03:13
@deepak1556 deepak1556 requested a review from Copilot March 18, 2026 03:13
@deepak1556 deepak1556 marked this pull request as ready for review March 18, 2026 03:13
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 fixes the “Restart Extension Host” shutdown path so a blocked/rogue extension host utility process is reliably terminated (follow-up to window-lifecycle binding work) and adds a smoke test to prevent regressions (issue #296681).

Changes:

  • Add a waitForExit capability to the IExtensionHostStarter utility-process API and expose it to the renderer-side extension host wrapper.
  • Ensure local extension host disconnect() requests graceful termination and then waits (with a grace period) before force-killing.
  • Add smoke test coverage validating that restarting the extension host kills a blocked old PID and spawns a new PID.

Reviewed changes

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

Show a summary per file
File Description
test/smoke/src/areas/extensions/extension-host-restart.test.ts Adds a smoke test for “Restart Extension Host” ensuring the old blocked PID is terminated and a new PID appears.
test/smoke/extensions/vscode-smoketest-ext-host/extension.js Writes the ext host PID on activation so the smoke test can observe the new PID after restart.
src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts Implements disconnect() to send terminate + wait/force-kill via the utility process starter API.
src/vs/platform/extensions/electron-main/extensionHostStarter.ts Wires windowLifecycleGraceTime to a shared constant and adds waitForExit implementation over WindowUtilityProcess.
src/vs/platform/extensions/common/extensionHostStarter.ts Introduces extensionHostGraceTimeMs constant and adds waitForExit to the starter interface.

You can also share your feedback on Copilot code review. Take the survey.

}

if (this._extensionHostProcess) {
await this._extensionHostProcess.waitForExit(extensionHostGraceTimeMs);
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.

Rogue Code Helper (Plugin) process when uninstalling / unloading extensions

2 participants