@@ -677,7 +677,7 @@ index 3715cbb8e6ee41c3d9b5090918d243b723ae2d00..c65de8ad37e727d66da97a8f8b170cbc
677
677
-
678
678
-
679
679
diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts
680
- index 18d3d04fd20335975293e37b3b641120dd92da20..4e49f9d63623da6c84624144765f76ec127ea526 100644
680
+ index 18d3d04fd20335975293e37b3b641120dd92da20..e072fc38ccd950462f42fdf112c8e7e673f351f5 100644
681
681
--- a/src/vs/platform/remote/common/remoteAgentConnection.ts
682
682
+++ b/src/vs/platform/remote/common/remoteAgentConnection.ts
683
683
@@ -92,7 +92,7 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio
@@ -689,6 +689,53 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..4e49f9d63623da6c84624144765f76ec
689
689
(err: any, socket: ISocket | undefined) => {
690
690
if (err || !socket) {
691
691
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
692
+ @@ -411,16 +411,23 @@ abstract class PersistentConnection extends Disposable {
693
+ }
694
+ const logPrefix = commonLogPrefix(this._connectionType, this.reconnectionToken, true);
695
+ this._options.logService.info(`${logPrefix} starting reconnecting loop. You can get more information with the trace log level.`);
696
+ - this._onDidStateChange.fire(new ConnectionLostEvent());
697
+ const TIMES = [5, 5, 10, 10, 10, 10, 10, 30];
698
+ + const SHOW_POPUP_ON_ATTEMPT = 2 // aka third attempt
699
+ +
700
+ const disconnectStartTime = Date.now();
701
+ let attempt = -1;
702
+ do {
703
+ attempt++;
704
+ + if (attempt == SHOW_POPUP_ON_ATTEMPT){
705
+ + this._onDidStateChange.fire(new ConnectionLostEvent());
706
+ + }
707
+ +
708
+ const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]);
709
+ try {
710
+ const sleepPromise = sleep(waitTime);
711
+ - this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
712
+ + if (attempt >= SHOW_POPUP_ON_ATTEMPT) {
713
+ + this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
714
+ + }
715
+
716
+ this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`);
717
+ try {
718
+ @@ -433,14 +440,17 @@ abstract class PersistentConnection extends Disposable {
719
+ }
720
+
721
+ // connection was lost, let's try to re-establish it
722
+ - this._onDidStateChange.fire(new ReconnectionRunningEvent());
723
+ + if (attempt >= SHOW_POPUP_ON_ATTEMPT){
724
+ + this._onDidStateChange.fire(new ReconnectionRunningEvent());
725
+ + }
726
+ this._options.logService.info(`${logPrefix} resolving connection...`);
727
+ const simpleOptions = await resolveConnectionOptions(this._options, this.reconnectionToken, this.protocol);
728
+ this._options.logService.info(`${logPrefix} connecting to ${simpleOptions.host}:${simpleOptions.port}...`);
729
+ await connectWithTimeLimit(simpleOptions.logService, this._reconnect(simpleOptions), RECONNECT_TIMEOUT);
730
+ this._options.logService.info(`${logPrefix} reconnected!`);
731
+ - this._onDidStateChange.fire(new ConnectionGainEvent());
732
+ -
733
+ + if (attempt >= SHOW_POPUP_ON_ATTEMPT) {
734
+ + this._onDidStateChange.fire(new ConnectionGainEvent());
735
+ + }
736
+ break;
737
+ } catch (err) {
738
+ if (err.code === 'VSCODE_CONNECTION_ERROR') {
692
739
diff --git a/src/vs/platform/storage/browser/storageService.ts b/src/vs/platform/storage/browser/storageService.ts
693
740
index ab3fd347b69f8a3d9b96e706cd87c911b8ffed6b..9d351037b577f9f1edfd18ae9b3c48a211f4467f 100644
694
741
--- a/src/vs/platform/storage/browser/storageService.ts
0 commit comments