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

chore: option to restart with sandbox disabled when workbench launch fails #186265

Closed
wants to merge 1 commit into from

Conversation

deepak1556
Copy link
Collaborator

Better error flow for #184687 (comment)

@deepak1556 deepak1556 added this to the June 2023 milestone Jun 27, 2023
@deepak1556 deepak1556 requested a review from bpasero June 27, 2023 06:28
this.updateChromiumSandboxEnablement(false);
this.lifecycleMainService.relaunch();
} else {
await this.destroyWindow(false, false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
await this.destroyWindow(false, false);
this.lifecycleMainService.quit();

Copy link
Member

Choose a reason for hiding this comment

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

Not sure? This is to reload a crashed window.

@@ -612,6 +614,40 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return this.marketplaceHeadersPromise;
}

private async updateChromiumSandboxEnablement(enable: boolean): Promise<void> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this duplicated from

private async updateCrashReporterEnablement(): Promise<void> {
, would it better to de-duplicate

Copy link
Member

Choose a reason for hiding this comment

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

Yes that would be better. How about a reusable method in src/vs/platform/environment/node/argv.ts?

@@ -612,6 +614,40 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return this.marketplaceHeadersPromise;
}

private async updateChromiumSandboxEnablement(enable: boolean): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

Yes that would be better. How about a reusable method in src/vs/platform/environment/node/argv.ts?

@@ -707,6 +743,23 @@ export class CodeWindow extends Disposable implements ICodeWindow {
let message: string;
if (!details) {
message = localize('appGone', "The window terminated unexpectedly");
} else if (details.reason === 'launch-failed' && details.exitCode === 18) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we only do this on Windows? Or will this also happen on Linux and macOS?

const { response } = await this.dialogMainService.showMessageBox({
type: 'warning',
buttons: [
localize({ key: 'restart', comment: ['&& denotes a mnemonic'] }, "&&Restart")
Copy link
Member

Choose a reason for hiding this comment

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

We should also have a "Learn more" button to explain the impact further.

}, this._win);
if (response === 0) {
this.updateChromiumSandboxEnablement(false);
this.lifecycleMainService.relaunch();
Copy link
Member

Choose a reason for hiding this comment

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

I think we should still destroy the window to ensure an orderly shutdown. I would suggest to have another parameter for destroyWindow to trigger a relaunch instead of a reload of the window.

@deepak1556 deepak1556 modified the milestones: June 2023, July 2023 Jun 27, 2023
@deepak1556 deepak1556 closed this Jul 25, 2023
@deepak1556 deepak1556 deleted the robo/better_error_flow_sandbox branch July 25, 2023 01:15
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants