Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcefully kill extension host processes if they still exist #196811

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/vs/platform/extensions/electron-main/extensionHostStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ export class ExtensionHostStarter implements IDisposable, IExtensionHostStarter
extHost.dispose();
this._extHosts.delete(id);
});

// See https://github.com/microsoft/vscode/issues/194477
// We have observed that sometimes the process sends an exit
// event, but does not really exit and is stuck in an endless
// loop. In these cases we kill the process forcefully after
// a certain timeout.
setTimeout(() => {
try {
process.kill(pid, 0); // will throw if the process doesn't exist anymore.
this._logService.error(`Extension host with pid ${pid} still exists, forcefully killing it...`);
process.kill(pid);
} catch (er) {
// ignore, as the process is already gone
}
}, 1000);
});
return { id };
}
Expand Down