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

Increase ping timeout for registries #17116

Merged
merged 1 commit into from
Oct 19, 2015

Conversation

dmcgowan
Copy link
Member

Ensure v2 registries are given more than 5 seconds to return a ping and avoid an unnecessary fallback to v1.

Some v1 only registries may experience the additional 10 second delay if the /v2 endpoint is not returning a result.

@icecrime
Copy link
Contributor

LGTM with a small thing: can we please make sure there's a log on the daemon-side when we hit a timeout while trying to ping? Thanks!

@dmcgowan
Copy link
Member Author

Something would already get logged

DEBU[0017] Error getting v2 registry: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection

also seen this

DEBU[0008] Error getting v2 registry: Get https://registry-1.docker.io/v2/: read tcp 52.4.239.183:443: use of closed network connection

@calavera
Copy link
Contributor

@dmcgowan it looks like that's debug level, isn't it? I think what @icecrime is asking is for an error at the error level that say something like request timed out...

Ensure v2 registries are given more than 5 seconds to return a ping and avoid an unnecessary fallback to v1.
Elevates log level about failed v2 ping to a warning to match the warning related to using v1 registries.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
@dmcgowan dmcgowan force-pushed the increase-ping-timeout branch from 81b1183 to f8ea4ad Compare October 16, 2015 22:34
@dmcgowan
Copy link
Member Author

Since we are now warning when using a v1 registry it would make sense to elevate this message from Debug to Warn. Checking whether the request failed because it was a timeout would require a larger code change since the error type does not indicate whether a timeout occurred. The hidden http.httpError type does have a Timeout() bool function which can be tested for, however in both the cases I mentioned above the error is actually a url.Error with no way of extracting whether it occurred as a result of a timeout. The correct way to do this is through supporting the CancelRequest method as suggested by http.Client.

@calavera
Copy link
Contributor

I'm okay with this warning.

LGTM

tiborvass added a commit that referenced this pull request Oct 19, 2015
Increase ping timeout for registries
@tiborvass tiborvass merged commit 1ab5ca2 into moby:master Oct 19, 2015
@tiborvass tiborvass removed their assignment Oct 22, 2015
@dmcgowan dmcgowan deleted the increase-ping-timeout branch June 15, 2016 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants