From c7ef3025e42c1e16f16011ee7330856be9438e67 Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Fri, 5 Dec 2025 12:16:46 -0300 Subject: [PATCH] remoting: Server download connect timeout (#44216) Sometimes machines are configured to drop outbound packets (rather than reject connections). In these cases, curl/wget just hang causing our download step to never complete. This PR adds a timeout of 10s for the connection (not the whole download), so that in situations like this we can fallback to our client-side download eventually. Related to but doesn't fully fix: https://github.com/zed-industries/zed/issues/43694 and https://github.com/zed-industries/zed/issues/43718 Release Notes: - remote: Add 10s connect timeout for server download --- crates/remote/src/transport/ssh.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index 56f29be092b5ed6ab4993664eb256056837047f5..bdc9cda08a9634258a4e18532556c1cde2bf8f32 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -668,6 +668,8 @@ impl SshRemoteConnection { delegate.set_status(Some("Downloading remote development server on host"), cx); + const CONNECT_TIMEOUT_SECS: &str = "10"; + match self .socket .run_command( @@ -676,6 +678,8 @@ impl SshRemoteConnection { &[ "-f", "-L", + "--connect-timeout", + CONNECT_TIMEOUT_SECS, url, "-o", &tmp_path_gz.display(self.path_style()), @@ -701,7 +705,15 @@ impl SshRemoteConnection { .run_command( self.ssh_shell_kind, "wget", - &[url, "-O", &tmp_path_gz.display(self.path_style())], + &[ + "--connect-timeout", + CONNECT_TIMEOUT_SECS, + "--tries", + "1", + url, + "-O", + &tmp_path_gz.display(self.path_style()), + ], true, ) .await