Always log on tsserver exits (#156495)

This ensures we also log if the TS Server exits with no code but a valid signal. Useful for figuring out how many users are hitting OOM errors
This commit is contained in:
Matt Bierner
2022-07-27 12:58:52 -07:00
committed by GitHub
parent 7b376e0704
commit 06f8d52e37

View File

@@ -431,24 +431,22 @@ export default class TypeScriptServiceClient extends Disposable implements IType
handle.onExit((data: TypeScriptServerExitEvent) => {
const { code, signal } = data;
if (code === null || typeof code === 'undefined') {
this.info(`TSServer exited. Signal: ${signal}`);
} else {
// In practice, the exit code is an integer with no ties to any identity,
// so it can be classified as SystemMetaData, rather than CallstackOrException.
this.error(`TSServer exited with code: ${code}. Signal: ${signal}`);
/* __GDPR__
"tsserver.exitWithCode" : {
"owner": "mjbvz",
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"${include}": [
"${TypeScriptCommonProperties}"
]
}
*/
this.logTelemetry('tsserver.exitWithCode', { code, signal: signal ?? undefined });
}
this.error(`TSServer exited. Code: ${code}. Signal: ${signal}`);
// In practice, the exit code is an integer with no ties to any identity,
// so it can be classified as SystemMetaData, rather than CallstackOrException.
/* __GDPR__
"tsserver.exitWithCode" : {
"owner": "mjbvz",
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"${include}": [
"${TypeScriptCommonProperties}"
]
}
*/
this.logTelemetry('tsserver.exitWithCode', { code: code ?? undefined, signal: signal ?? undefined });
if (this.token !== mytoken) {
// this is coming from an old process