-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
electron - limit crash reporter to few insiders users #132961
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,28 +214,34 @@ export class LocalProcessExtensionHost implements IExtensionHost { | |
opts.execArgv.unshift(`--max-old-space-size=${this._environmentService.args['max-memory']}`); | ||
} | ||
|
||
// On linux crash reporter needs to be started on child node processes explicitly | ||
// On linux crash reporter needs to be started on | ||
// child node processes explicitly if enabled either | ||
// because a crash directory is specified or a crashId. | ||
if (platform.isLinux) { | ||
const crashReporterStartOptions: CrashReporterStartOptions = { | ||
companyName: this._productService.crashReporter?.companyName || 'Microsoft', | ||
productName: this._productService.crashReporter?.productName || this._productService.nameShort, | ||
submitURL: '', | ||
uploadToServer: false | ||
}; | ||
const crashReporterId = this._environmentService.crashReporterId; // crashReporterId is set by the main process only when crash reporting is enabled by the user. | ||
const appcenter = this._productService.appCenter; | ||
const uploadCrashesToServer = !this._environmentService.crashReporterDirectory; // only upload unless --crash-reporter-directory is provided | ||
if (uploadCrashesToServer && appcenter && crashReporterId && isUUID(crashReporterId)) { | ||
const submitURL = appcenter[`linux-x64`]; | ||
crashReporterStartOptions.submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId); | ||
crashReporterStartOptions.uploadToServer = true; | ||
const crashReporterDirectory = this._environmentService.crashReporterDirectory; | ||
const crashReporterId = this._environmentService.crashReporterId; | ||
if (crashReporterDirectory || crashReporterId) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now using these properties as a hint whether crash reporting is enabled at all. |
||
const crashReporterStartOptions: CrashReporterStartOptions = { | ||
companyName: this._productService.crashReporter?.companyName || 'Microsoft', | ||
productName: this._productService.crashReporter?.productName || this._productService.nameShort, | ||
submitURL: '', | ||
uploadToServer: false | ||
}; | ||
|
||
const appcenter = this._productService.appCenter; | ||
const uploadCrashesToServer = !crashReporterDirectory; // only upload unless --crash-reporter-directory is provided | ||
if (uploadCrashesToServer && appcenter && crashReporterId && isUUID(crashReporterId)) { | ||
crashReporterStartOptions.submitURL = `${appcenter['linux-x64']}&uid=${crashReporterId}&iid=${crashReporterId}&sid=${crashReporterId}`; | ||
crashReporterStartOptions.uploadToServer = true; | ||
} | ||
|
||
// In the upload to server case, there is a bug in electron that creates client_id file in the current | ||
// working directory. Setting the env BREAKPAD_DUMP_LOCATION will force electron to create the file in that location, | ||
// For https://github.com/microsoft/vscode/issues/105743 | ||
const extHostCrashDirectory = crashReporterDirectory || this._environmentService.userDataPath; | ||
opts.env.BREAKPAD_DUMP_LOCATION = join(extHostCrashDirectory, `${ExtensionHostLogFileName} Crash Reports`); | ||
opts.env.VSCODE_CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterStartOptions); | ||
} | ||
// In the upload to server case, there is a bug in electron that creates client_id file in the current | ||
// working directory. Setting the env BREAKPAD_DUMP_LOCATION will force electron to create the file in that location, | ||
// For https://github.com/microsoft/vscode/issues/105743 | ||
const extHostCrashDirectory = this._environmentService.crashReporterDirectory || this._environmentService.userDataPath; | ||
opts.env.BREAKPAD_DUMP_LOCATION = join(extHostCrashDirectory, `${ExtensionHostLogFileName} Crash Reports`); | ||
opts.env.VSCODE_CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterStartOptions); | ||
} | ||
|
||
// Run Extension Host as fork of current process | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is a heuristic I picked, but maybe you have a better idea.
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.
@deepak1556 I ran some experiments generating
30000
UUIDs to roughly simulate our number of present insider users and typically end up with a number around~1900
that match. Would you think that number if sufficient to find crashes?