From 502323a9c8bc6c7a203ba9badd71c2a81d2e2fb5 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 25 Feb 2021 12:19:21 -0700 Subject: [PATCH] fix: conflicts with remoteAgentConnection As Asher pointed out, looks like it makes #2381 obsolete. Hope this all works. --- .../remote/common/remoteAgentConnection.ts | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts b/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts index da4b5e3a4..4d80e2045 100644 --- a/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts +++ b/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts @@ -86,23 +86,6 @@ export interface ISocketFactory { connect(host: string, port: number, query: string, callback: IConnectCallback): void; } -<<<<<<< HEAD -async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptions, connectionType: ConnectionType, args: any | undefined): Promise<{ protocol: PersistentProtocol; ownsProtocol: boolean; }> { - const logPrefix = connectLogPrefix(options, connectionType); - const { protocol, ownsProtocol } = await new Promise<{ protocol: PersistentProtocol; ownsProtocol: boolean; }>((c, e) => { - options.logService.trace(`${logPrefix} 1/6. invoking socketFactory.connect().`); - options.socketFactory.connect( - options.host, - options.port, - `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, - (err: any, socket: ISocket | undefined) => { - if (err || !socket) { - options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`); - options.logService.error(err); - e(err); - return; - } -======= async function readOneControlMessage(protocol: PersistentProtocol): Promise { const raw = await Event.toPromise(protocol.onControlMessage); const msg = JSON.parse(raw.toString()); @@ -112,7 +95,6 @@ async function readOneControlMessage(protocol: PersistentProtocol): Promise>>>>>> 89b6e0164fa770333755b11504e19a4232b1a2d4 function waitWithTimeout(promise: Promise, timeout: number): Promise { return new Promise((resolve, reject) => { @@ -496,25 +478,15 @@ abstract class PersistentConnection extends Disposable { attempt++; const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]); try { -<<<<<<< HEAD - const sleepPromise = sleep(waitTime); - this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise, attempt+1)); - - this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`); - try { - await sleepPromise; - } catch { } // User canceled timer -======= if (waitTime > 0) { const sleepPromise = sleep(waitTime); - this._onDidStateChange.fire(new ReconnectionWaitEvent(this.reconnectionToken, this.protocol.getMillisSinceLastIncomingData(), waitTime, sleepPromise)); + this._onDidStateChange.fire(new ReconnectionWaitEvent(this.reconnectionToken, this.protocol.getMillisSinceLastIncomingData(), waitTime, sleepPromise, attempt)); this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`); try { await sleepPromise; } catch { } // User canceled timer } ->>>>>>> 89b6e0164fa770333755b11504e19a4232b1a2d4 if (PersistentConnection._permanentFailure) { this._options.logService.error(`${logPrefix} permanent failure occurred while running the reconnecting loop.`);