Adds a timeout context to the ssh waiter to prevent indefinite hanging#4635
Merged
Adds a timeout context to the ssh waiter to prevent indefinite hanging#4635
Conversation
josebalius
approved these changes
Oct 29, 2021
Contributor
There was a problem hiding this comment.
Looks reasonable to me, I looked at all rpc calls and can't think why any one of them should take more than 2 minutes. StartSSHServer is the one with the potential to take the longest in the case that it has to install but if @edgonmsft said it should never take that long than 👍
Closed
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.
This patch adds a timeout to the ssh call waiter in the liveshare client. While the hope is to never have issues that would cause the liveshare client call to hang in the first place, we have now seen cases of it happening so this prevents users from having requests stall for more than a couple of minutes.
I was able to test this works by having my local build ssh into a codespace that I had changed the sshd_config port on without restarting sshd itself.
gh cs sshthen tries to ssh using the incorrect port and hangs for the correct 2 mins before giving:Without the new context the request hangs for much longer (reportedly 8-9 minutes at times) before aborting.
Closes: https://github.com/github/cli/issues/100