-
Notifications
You must be signed in to change notification settings - Fork 4
impl: support for configuring SSH connection timeout #256
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
base: main
Are you sure you want to change the base?
Conversation
Staring with Toolbox 3.3 the SSH connection timeout will be enforced by passing the value to the SSH command. Up until today the Coder plugin relied only on the default value (10 seconds) which was anyway ignored by Toolbox (i.e. it was not passed to the SSH command) On the other hand we generate the SSH config with ConnectionTimeout = 0 which effectively means unlimited timeout. Once Toolbox 3.3 is released the command parameter will take precedence over the SSH config time out. With his PR there is now a user configurable setting via the UI Settings page which defaults to 10 seconds, and it is passed to both the command line but also to the config file. - resolves https://youtrack.jetbrains.com/issue/TBX-17312
Right now it is hardcoded to 0, which means it is up to the OS how much it will allow waiting for. The user now has the option to configure this value from the UI which is then passed to the ssh command (via the -o option). The config file should reflect the value configured by the user.
This is needed in order to update the ssh config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me except I thought ConnectTimeout = 0 meant to wait indefinitely. Should we default to zero to maintain that behavior?
The man page is not clear on the behavior of zero but the source code shows it blocks indefinitely:
https://github.com/openssh/openssh-portable/blob/master/misc.c#L419-L420
https://github.com/openssh/openssh-portable/blob/master/misc.c#L431-L433
|
This is what Linux man pages say: https://linux.die.net/man/5/ssh_config
That is a good question, I went in with the "default" value that Toolbox had but which it never enforced. |
|
Hrm yeah my confusion was that if you insert a timeout of zero into that text, the literal reading is "zero [is] used [...] instead of using the default system TCP timeout", which seems to suggest the default system timeout is ignored in that case. If zero is a special case, they fail to mention it in the manpage. Apparently |
Starting with Toolbox 3.3 the SSH connection timeout will be enforced by passing the value to the SSH command. Up until today the Coder plugin relied only on the default value (10 seconds) which was anyway ignored by Toolbox (i.e. it was not passed to the SSH command)
On the other hand we generate the SSH config with ConnectTimeout = 0 which effectively means whatever the OS configured. Once Toolbox 3.3 is released the command parameter will take precedence over the SSH config timeout.
With his PR there is now a user configurable setting via the UI Settings page which defaults to 10 seconds, and it is passed to both the command line but also to the config file.