-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Conversation
this.updateChromiumSandboxEnablement(false); | ||
this.lifecycleMainService.relaunch(); | ||
} else { | ||
await this.destroyWindow(false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await this.destroyWindow(false, false); | |
this.lifecycleMainService.quit(); |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this duplicated from
vscode/src/vs/code/electron-main/app.ts
Line 1316 in ac34ea3
private async updateCrashReporterEnablement(): Promise<void> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
Better error flow for #184687 (comment)