mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Add a watchdog mechanism to detect when the extension host JavaScript event loop is unresponsive (#26445)
This commit is contained in:
@@ -17,6 +17,7 @@ import { DiskSearch } from 'vs/workbench/services/search/node/searchService';
|
||||
import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry';
|
||||
import { IInitData, IEnvironment, IWorkspaceData, MainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import * as watchdog from 'native-watchdog';
|
||||
|
||||
const nativeExit = process.exit.bind(process);
|
||||
process.exit = function () {
|
||||
@@ -51,6 +52,9 @@ export class ExtensionHostMain {
|
||||
// Error forwarding
|
||||
const mainThreadErrors = threadService.get(MainContext.MainThreadErrors);
|
||||
errors.setUnexpectedErrorHandler(err => mainThreadErrors.onUnexpectedExtHostError(errors.transformErrorForSerialization(err)));
|
||||
|
||||
// Configure the watchdog to kill our process if the JS event loop is unresponsive for more than 10s
|
||||
watchdog.start(10000);
|
||||
}
|
||||
|
||||
public start(): TPromise<void> {
|
||||
|
||||
Reference in New Issue
Block a user