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

Override connect timeout #194

Merged
merged 4 commits into from
Jan 31, 2024
Merged

Override connect timeout #194

merged 4 commits into from
Jan 31, 2024

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jan 26, 2024

See coder/coder#10473

After this change you can see in the logs:

[13:50:25.629] > local-server-1> Running ssh connection command: "-v -T -D 43233 -o ConnectTimeout=1800 coder-vscode--code-asher--dev27--dev bash"

`parsed` is not used anywhere so I deleted it.
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, thanks for making this change @code-asher! 🎉

I think my dev env was broken somehow because I just couldn't get it to work, glad you did!

src/remote.ts Outdated Show resolved Hide resolved
src/remote.ts Outdated Show resolved Hide resolved
@code-asher code-asher force-pushed the asher/configure-timeout branch 3 times, most recently from 3e8f23f to ff8c679 Compare January 30, 2024 19:50
@code-asher
Copy link
Member Author

Made the changes! One open question is whether there is a better way to detect when we are connected. I am using findSSHProcessID() but I suppose we could reset the value early if we are unable to find it or it takes too long to spawn. It might be good enough though.

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes! Good point about SSH process, would it be possible that it exits very fast and won't be found? Maybe we could use a race between find process and a timeout promise. But if we do, we should make sure the timeout starts after we've activated the Remote SSH extension.

@code-asher
Copy link
Member Author

Yup it would be possible that it exits fast, but findSSHProcessID() does also have a timeout (15 seconds) so it will eventually resolve and then we will revert the setting. The remote extension activates right after we set this up so I think it is as good as we will get it!

Could have sworn I ran this.
@code-asher code-asher merged commit b2d31b8 into main Jan 31, 2024
2 checks passed
@code-asher code-asher deleted the asher/configure-timeout branch January 31, 2024 07:10
@code-asher code-asher self-assigned this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants