Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry connecting even if the initial connection fails #127565

Closed
alexdima opened this issue Jun 29, 2021 · 2 comments · Fixed by #156444
Closed

Retry connecting even if the initial connection fails #127565

alexdima opened this issue Jun 29, 2021 · 2 comments · Fixed by #156444
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders remote-connection Issues about the remote connection verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

When connecting to a remote, if the initial connection fails, we will give up. The idea was that retrying would be useless, since the initial setup might have failed. But it is possible that perhaps it was an intermittent network error.

@alexdima alexdima added feature-request Request for new features or functionality remote Remote system operations issues labels Jun 29, 2021
@alexdima alexdima added this to the July 2021 milestone Jun 29, 2021
@alexdima alexdima self-assigned this Jun 29, 2021
@alexdima alexdima modified the milestones: July 2021, August 2021 Jul 14, 2021
@EmbeddedBacon
Copy link

One of the annoyances I have is all my open editors tabs are closed. I have to try and remember what editor tabs I had open which often leads to lost time and effort trying to recall. I did create a ticket #128890 for this, which is how I found this as it was suggested, Ideally, even if can't connect need the ability to save/restore the prior editor tabs that were open or currently opened.

@alexdima alexdima modified the milestones: August 2021, September 2021 Aug 26, 2021
@alexdima alexdima modified the milestones: September 2021, October 2021 Sep 29, 2021
@alexdima alexdima added remote-connection Issues about the remote connection and removed remote Remote system operations issues labels Oct 15, 2021
@alexdima alexdima modified the milestones: October 2021, On Deck Oct 27, 2021
@alexdima alexdima modified the milestones: On Deck, July 2022 Jul 12, 2022
@alexdima
Copy link
Member Author

alexdima commented Jul 27, 2022

This can be verified running from source with the test resolver, using a change like the following:

diff --git a/extensions/vscode-test-resolver/src/extension.ts b/extensions/vscode-test-resolver/src/extension.ts
index 05fd267d2bc..90eb17c62a8 100644
--- a/extensions/vscode-test-resolver/src/extension.ts
+++ b/extensions/vscode-test-resolver/src/extension.ts
@@ -264,7 +264,13 @@ export function activate(context: vscode.ExtensionContext) {
 		async getCanonicalURI(uri: vscode.Uri): Promise<vscode.Uri> {
 			return vscode.Uri.file(uri.path);
 		},
-		resolve(_authority: string): Thenable<vscode.ResolvedAuthority> {
+		resolve(_authority: string, _context: vscode.RemoteAuthorityResolverContext): Thenable<vscode.ResolvedAuthority> {
+			if (_context.resolveAttempt <= 3) {
+				throw new Error(`FAILING ON resolveAttempt ${_context.resolveAttempt}`);
+			}
+			if (_context.resolveAttempt <= 4) {
+				return Promise.resolve({ host: '127.0.0.1', port: 8585, connectionToken: undefined });
+			}
 			return vscode.window.withProgress({
 				location: vscode.ProgressLocation.Notification,
 				title: 'Open TestResolver Remote ([details](command:vscode-testresolver.showLog))',

Then, run ./scripts/code.sh and from the bottom left open the test resolver. The resulting window should connect despite the resolver returning errors or resolving with an address which leads to a connection error.

alexdima added a commit that referenced this issue Jul 27, 2022
…d retry up to 5 times the initial connection
alexdima added a commit that referenced this issue Jul 27, 2022
… to 5 times the initial connection (#156444)

Fixes #127565: Retry up to 5 times the initial authority resolving and retry up to 5 times the initial connection
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jul 27, 2022
@alexdima alexdima added the verification-needed Verification of issue is requested label Jul 28, 2022
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 28, 2022
@alexr00 alexr00 added the verified Verification succeeded label Jul 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders remote-connection Issues about the remote connection verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
4 participants