-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cli: set timeout connection ping on sockets as well #3722
Conversation
Note that this does not fully fix the referenced issue, but at least makes sure that API clients don't hang forever on the initialization step. See: docker#3652 Signed-off-by: Nick Santos <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
func (cli *DockerCli) initializeFromClient() { | ||
ctx := context.Background() | ||
if strings.HasPrefix(cli.DockerEndpoint().Host, "tcp://") { | ||
if !strings.HasPrefix(cli.DockerEndpoint().Host, "ssh://") { | ||
// @FIXME context.WithTimeout doesn't work with connhelper / ssh connections | ||
// time="2020-04-10T10:16:26Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: killed" |
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.
I know it isn't a part of this PR, but maybe you remember how does context.WithTimeout has anything to do with ssh being used? The PR that introduced this doesn't mention any details here.
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.
Just curious - so if you remember then just some quick tldr will be enough 😄
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.
I'm not sure how much time I spent at the time digging into the exact cause; the timeout was helping with an issue (see #2424), and I'm not sure I was able to consistently reproduce the ssh problem locally (or only in CI?). Ultimately decided that the SSH connections were less common, so to keep diving into the issue for later (there's some other issues remaining with the ssh connection helper as well).
In case useful;
- ssh implementation; support SSH connection #1014
- multiplexing change that we reverted due to CI issues (but should look into to have it merged again) revert "connhelper: use ssh multiplexing" #2303
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.
It may be just missing functionality in the ssh connecting helper (it not handling context cancelation), but yeah, never found the time really to get myself familiar with that code or to dig into the issue.
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.
Thanks!
Let me bring this one in |
Note that this does not fully fix the referenced issue, but
at least makes sure that API clients don't hang forever on
the initialization step.
See: #3652
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)