-
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
Docker commands take 1 minute to timeout if context endpoint is unreachable #1739
Comments
I suppose the @thaJeztah I will have a look at it |
I just looked at it, and it comes from the early call to initializeFromClient in the CLI Initialize function. Actually the problem seems to be present in 18.09 as well: https://github.com/docker/cli/blob/18.09/cli/command/cli.go#L197. I suppose I can work on a fix for the upcoming version, but it might be difficult to backport. |
This partially mitigates docker#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") and is a simpler alternative to docker#1747 (which completely defers the client connection until an actual call is attempted). Note that the previous 60s delay was the culmination of two separate 30s timeouts since the ping is tried twice. This with this patch the overall timeout is 20s. moby/moby#39206 will remove the second ping and once that propagates to this tree the timeout will be 10s. Signed-off-by: Ian Campbell <[email protected]>
When we see an `ECONNREFUSED` (or equivalent) from an attempted `HEAD` on the `/_ping` endpoint there is no point in trying again with `GET` since the server is not responding/available at all. Once vendored into the cli this will partially mitigate docker/cli#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") by cutting the effective timeout in half. Signed-off-by: Ian Campbell <[email protected]> (cherry picked from commit 8c8457b) Signed-off-by: Sebastiaan van Stijn <[email protected]>
When we see an `ECONNREFUSED` (or equivalent) from an attempted `HEAD` on the `/_ping` endpoint there is no point in trying again with `GET` since the server is not responding/available at all. Once vendored into the cli this will partially mitigate docker/cli#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") by cutting the effective timeout in half. Signed-off-by: Ian Campbell <[email protected]>
When we see an `ECONNREFUSED` (or equivalent) from an attempted `HEAD` on the `/_ping` endpoint there is no point in trying again with `GET` since the server is not responding/available at all. Once vendored into the cli this will partially mitigate docker/cli#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") by cutting the effective timeout in half. Signed-off-by: Ian Campbell <[email protected]> Upstream-commit: 8c8457b0f2f85d58c0e1a5b4a0e174d7808cf886 Component: engine
When we see an `ECONNREFUSED` (or equivalent) from an attempted `HEAD` on the `/_ping` endpoint there is no point in trying again with `GET` since the server is not responding/available at all. Once vendored into the cli this will partially mitigate docker/cli#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") by cutting the effective timeout in half. Signed-off-by: Ian Campbell <[email protected]>
This helps to address docker/cli#1739, where an invalid `DOCKER_HOST` setting could result in a 64s delay (that's twice the delay here because the client was trying to hit the `/_ping` endpoint twice, which was addressed in moby/moby#39206) I made a previous attempt to fix this purely on the Docker cli side (docker/cli#1872) however that had the side effect of adding the timeout across the board and not just for the dial phase, which caused a regression for `docker logs -f` (docker/cli#1892) and so was reverted (docker/cli#1893). The new value of 10s is just based on a gut feeling, no initial connection should be taking that long in the real world unless something about the network link is pretty broken (e.g. bad dns perhaps), in which case affected users are surely pretty used to retrying things, better to fail faster in the normal case. Also drop the comment since the linked issue just shows that the original number, just like the new number, was arrived at fairly arbitrarily based on gut feelings (rather than anything empirical) so the reference is not really terribly useful. Signed-off-by: Ian Campbell <[email protected]>
When we see an `ECONNREFUSED` (or equivalent) from an attempted `HEAD` on the `/_ping` endpoint there is no point in trying again with `GET` since the server is not responding/available at all. Once vendored into the cli this will partially mitigate docker/cli#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") by cutting the effective timeout in half. Signed-off-by: Ian Campbell <[email protected]> (cherry picked from commit 8c8457b0f2f85d58c0e1a5b4a0e174d7808cf886) Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 61a234d5621cf130db4beb163b8f0b357a27764f Component: engine
Description
The upcoming context feature seem to cause CLI commands to pause for a 1 minute timeout if the current context's endpoint is not reachable.
Some of my Docker endpoints are only reachable via a VPN connection. If the current context is for an endpoint that I cannot currently reach, every command takes an extra minute (60 seconds) to complete.
Steps to reproduce the issue:
docker context ls
ordocker info
.Describe the results you received:
When the endpoint is unreachable, commands take an extra minute to complete.
In this example, when I switch to
psc-prod-gen
without the requisite network access, Docker CLI commands go through a 1 minute timeout. Even switching back to thedefault
context for my local Docker config takes a minute.Describe the results you expected:
Commands should fail immediately if the endpoint is unreachable.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: