-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: adjust ssh config time resolution #10803
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
Conversation
…conds to milliseconds
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.
Pull Request Overview
Fixes a unit conversion issue where OpenSSH configuration values for ServerAliveInterval and ConnectTimeout (measured in seconds) were being imported into Tabby as-is, despite Tabby expecting these values in milliseconds.
- Separated handling of KeepaliveInterval and ReadyTimeout from other integer properties
- Added conversion logic to multiply these time-based values by 1000 during import
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
|
I don't see any runtime changes that your PR could introduce? |
The ServerAliveInterval and ConnectTimeout directives in the standard SSH config are originally specified in seconds, and OpenSSH clients interpret them as such. However, Tabby internally handles its corresponding fields—KeepAliveInterval and ReadyTimeout—in milliseconds (ms). During the config import process, Tabby currently assigns the ServerAliveInterval and ConnectTimeout values directly to its internal fields. This mismatch in units causes problems: If a user sets a standard parameter like 60 (1 minute) in their OpenSSH config, Tabby treats this as 60ms. Furthermore, if there is a subsequent division by 1000 internally, the field value becomes 0 because the value is less than 1000. This results in a connection error when attempting to connect using the imported SSH profile. To set a functional value, a user must currently specify a value of 1000 or greater. The core issue is that setting the ServerAliveInterval to, say, 1000 seconds (to satisfy Tabby's ms requirement) virtually disables the heartbeat in any other standard SSH program, as the default SSH server timeout is usually around 300 seconds. Therefore, to eliminate this unit discrepancy and ensure compatibility, I've added logic to multiply the value by 1000 for these specific fields during the config import process. |
|
Oh nevermind - I was accidentally looking at a diff of a single commit only - thanks! |
|
@all-contributors add @osm1892 for code |
OpenSSH's ServerAliveInterval and ConnectTimeout are in seconds, while Tabby handles them as milliseconds.
To fix this incompatibility, the import process now multiplies these values by 1000, converting them from seconds to ms.