Skip to content

Reduce default connection time to 10s (from 32s)#63

Merged
thaJeztah merged 1 commit intodocker:masterfrom
ijc:reduce-timeout
May 21, 2019
Merged

Reduce default connection time to 10s (from 32s)#63
thaJeztah merged 1 commit intodocker:masterfrom
ijc:reduce-timeout

Conversation

@ijc
Copy link
Copy Markdown

@ijc ijc commented 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 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>
@ijc
Copy link
Copy Markdown
Author

ijc commented May 17, 2019

I debated whether to fix this here or to arrange to somehow overwrite/override the value in e.g. github.com/docker/docker/client. I decided that doing it at the root (i.e. here) made most sense.

@ijc
Copy link
Copy Markdown
Author

ijc commented May 17, 2019

Hrm, monkey patching this change into the CLI doesn't seem to have worked, something else may be going on. I'll investigate further.

@ijc
Copy link
Copy Markdown
Author

ijc commented May 17, 2019

something else may be going on.

mostly user stupidity (I was testing docker from $PATH not ./build/docker, oops!), plus the double from moby/moby#39206 which still affects the tree I was testing.

But so far as this change goes I believe it is effective and can go in.

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 2a820fc into docker:master May 21, 2019
@ijc ijc deleted the reduce-timeout branch May 21, 2019 13:38
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