mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
Disable unresponsive create process
This commit is contained in:
parent
11897d00a7
commit
5cc1775bbf
|
@ -139,9 +139,9 @@ export class PtyHostService extends Disposable implements IPtyService {
|
|||
}
|
||||
|
||||
async createProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, executableEnv: IProcessEnvironment, windowsEnableConpty: boolean, shouldPersist: boolean, workspaceId: string, workspaceName: string): Promise<number> {
|
||||
const timeout = setTimeout(() => this._handleUnresponsiveCreateProcess(), HeartbeatConstants.CreateProcessTimeout);
|
||||
// const timeout = setTimeout(() => this._handleUnresponsiveCreateProcess(), HeartbeatConstants.CreateProcessTimeout);
|
||||
const id = await this._proxy.createProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, shouldPersist, workspaceId, workspaceName);
|
||||
clearTimeout(timeout);
|
||||
// clearTimeout(timeout);
|
||||
lastPtyId = Math.max(lastPtyId, id);
|
||||
return id;
|
||||
}
|
||||
|
@ -220,11 +220,11 @@ export class PtyHostService extends Disposable implements IPtyService {
|
|||
this._onPtyHostUnresponsive.fire();
|
||||
}
|
||||
|
||||
private _handleUnresponsiveCreateProcess() {
|
||||
this._clearHeartbeatTimeouts();
|
||||
this._logService.error(`No ptyHost response to createProcess after ${HeartbeatConstants.CreateProcessTimeout / 1000} seconds`);
|
||||
this._onPtyHostUnresponsive.fire();
|
||||
}
|
||||
// private _handleUnresponsiveCreateProcess() {
|
||||
// this._clearHeartbeatTimeouts();
|
||||
// this._logService.error(`No ptyHost response to createProcess after ${HeartbeatConstants.CreateProcessTimeout / 1000} seconds`);
|
||||
// this._onPtyHostUnresponsive.fire();
|
||||
// }
|
||||
|
||||
private _clearHeartbeatTimeouts() {
|
||||
if (this._heartbeatFirstTimeout) {
|
||||
|
|
|
@ -208,9 +208,9 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
|||
} else {
|
||||
this._process = await this._remoteTerminalService.createProcess(shellLaunchConfig, activeWorkspaceRootUri, cols, rows, shouldPersist, this._configHelper);
|
||||
}
|
||||
// if (!this._isDisposed) {
|
||||
// this._setupPtyHostListeners(this._remoteTerminalService);
|
||||
// }
|
||||
if (!this._isDisposed) {
|
||||
this._setupPtyHostListeners(this._remoteTerminalService);
|
||||
}
|
||||
} else {
|
||||
if (!this._localTerminalService) {
|
||||
this._logService.trace(`Tried to launch a local terminal which is not supported in this window`);
|
||||
|
@ -233,6 +233,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
|||
}
|
||||
}
|
||||
|
||||
// If the process was disposed during its creation, shut it down and return failure
|
||||
if (this._isDisposed) {
|
||||
this._process.shutdown(false);
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in a new issue