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

[Remote-SSH Bug]: "remote.SSH.connectTimeout" overrides ConnectTimeout from config file #8519

Closed
3 tasks done
jeanp413 opened this issue May 22, 2023 · 3 comments
Closed
3 tasks done
Assignees
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH

Comments

@jeanp413
Copy link

jeanp413 commented May 22, 2023

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

-> Description

The "remote.SSH.connectTimeout" setting value overrides ConnectTimeout from config file

Expected Behavior

I expect ConnectTimeout from config file to have precedence over "remote.SSH.connectTimeout" as I have some host that require more time but in general I'm fine with the default value in vscode when no ConnectTimeout value is specified in config file

@jeanp413 jeanp413 added the ssh Issue in vscode-remote SSH label May 22, 2023
@roblourens roblourens added the feature-request Request for new features or functionality label May 22, 2023
@roblourens roblourens added this to the Backlog milestone May 22, 2023
@akosyakov
Copy link

To add: it should also respect when ConnectTimeout is configured as 0, meaning to disable it.

@joshspicer joshspicer assigned joshspicer and unassigned roblourens Sep 10, 2024
@joshspicer joshspicer modified the milestones: Backlog, September 2024 Sep 10, 2024
@akosyakov
Copy link

If it would be helpful one can test using the following shell script

#!/bin/bash

# Variables for the host and port from SSH configuration
HOST="$1"   # SSH will pass the host as the first argument
PORT="$2"   # SSH will pass the port as the second argument

# Sleep for 1 minute while printing a line every second
for i in {1..60}; do
    echo "Sleeping... $i seconds elapsed"
    sleep 1
done

# Now use nc to connect to the given host and port
echo "Attempting to connect to $HOST on port $PORT"
nc $HOST $PORT

And the configure the host in ssh config like:

Host my-host
  ProxyCommand /Users/my-user/.ssh/pause.sh %h %p
  ConnectTimeout 0

Given default Remote SSH settings, it fails right now like:
Screenshot 2024-09-11 at 11 02 07

Compare without Remote SSH:
Screenshot 2024-09-11 at 11 12 10

@joshspicer
Copy link
Member

This is shipped in the latest pre-release build (v0.115.2024092017 (pre-release)). I've tested with your repro steps and it is working well for me! Please give it a go and let me know if you have any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

4 participants