client: do not fallback to GET if HEAD on _ping fail to connect#39206
Merged
cpuguy83 merged 1 commit intomoby:masterfrom May 15, 2019
Merged
client: do not fallback to GET if HEAD on _ping fail to connect#39206cpuguy83 merged 1 commit intomoby:masterfrom
cpuguy83 merged 1 commit intomoby:masterfrom
Conversation
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 <ijc@docker.com>
ijc
pushed a commit
to ijc/docker-cli
that referenced
this pull request
May 13, 2019
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 <ijc@docker.com>
Member
|
experimental failures are unrelated |
docker-jenkins
pushed a commit
to docker-archive/docker-ce
that referenced
this pull request
May 14, 2019
This partially mitigates #1739 ("Docker commands take 1 minute to timeout if
context endpoint is unreachable") and is a simpler alternative to #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 <ijc@docker.com>
Upstream-commit: 59defcb34d5be358ebaacaadd21ed7e6307a493e
Component: cli
Codecov Report
@@ Coverage Diff @@
## master #39206 +/- ##
=========================================
Coverage ? 37.03%
=========================================
Files ? 612
Lines ? 45490
Branches ? 0
=========================================
Hits ? 16845
Misses ? 26350
Partials ? 2295 |
ijc
pushed a commit
to ijc/go-connections
that referenced
this pull request
May 17, 2019
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 <ijc@docker.com>
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.
When we see an
ECONNREFUSED(or equivalent) from an attemptedHEADon the/_pingendpoint there is no point in trying again withGETsince the serveris 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 ijc@docker.com
(I'm also shortly going to raise a cli PR to further reduce the delay by reducing the timeout).