Repository navigation
fix(ssh): bound the connect and tear down a connect that outlives its tab - #10
Open
andreas-byfut wants to merge 1 commit into
Open
andreas-byfut wants to merge 1 commit into
andreas-byfut wants to merge 1 commit into
Conversation
… tab Closing a tab while it was CONNECTING could leave the attempt running. disconnect() that ran before ssh.connect() started had no socket to close, and one that ran during a ProxyJump chain had no chain resources to tear down yet; the chain kept dialling, authenticating and prompting for a closed tab, and the final client was never closed. connectChainAndAuthenticate now polls a closing check before each hop, and connect() re-checks it once the transport is up and runs the existing teardown path. A hop already in flight is not interrupted. The TCP connect also had no timeout, so a black-holed host kept the session in CONNECTING for the OS's SYN retry limit. Set a 15s connect timeout.
Owner
|
Thanks. Fix looks solid but needs some revisions.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closing a tab while it was still CONNECTING could leave the connection attempt running:
disconnect()that ran beforessh.connect()started had no socket to close.host-key and keyboard-interactive prompts for a tab that was already closed. The final client
was never closed.
Changes:
connectChainAndAuthenticatetakes anisClosingcheck and polls it before each hop andbefore the final channel. On close it throws
IOExceptionand cleans up what it opened.connect()re-checks the close flag once the transport is up and runs the existing teardown.CONNECT_TIMEOUT_MS). Before, a black-holed host held thesession in CONNECTING until the OS gave up retrying SYN.
Known limits:
chain stops at the next hop boundary.
Tests:
ConnectTimeoutTest.