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

Fix httpclient setup for gcp credential provider to have timeout #28539

Merged

Conversation

derekwaynecarr
Copy link
Member

The default http client has no timeout.

This could cause problems when not on GCP environments.

This PR changes to use a 10s timeout, and ensures the transport has our normal defaults applied.

/cc @ncdc @liggitt

@derekwaynecarr derekwaynecarr changed the title Fix httpclient setup for gcp credential provider to have timeout and … Fix httpclient setup for gcp credential provider to have timeout Jul 6, 2016
@derekwaynecarr derekwaynecarr force-pushed the credential_provider_timeout branch from b905a34 to 5366bfe Compare July 6, 2016 17:37
@derekwaynecarr derekwaynecarr added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 6, 2016
@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 6, 2016
@ncdc
Copy link
Member

ncdc commented Jul 7, 2016

LGTM

@erictune
Copy link
Member

@cjcullen you know about metadata server availability issues. This is added a timeout when talking to metadata server. Thoughts?

@cjcullen
Copy link
Member

I think this is fine. All of the GCE metadata server flakiness I've seen manifests as a connection refused error.

In what case do we use the GCP credentialprovider in a non GCP environment? Or is this just preventing a possible error case from hanging indefinitely and leaking goroutines/fds?

@ncdc
Copy link
Member

ncdc commented Jul 12, 2016

@cjcullen at least in the image pulling keyring code we have, it tries to use the GCP credentialprovider even if you're not on GCP

@cjcullen
Copy link
Member

Hmmm. I'm hoping that's either in parallel or a faster fail than this 10s timeout?

Either way, I think adding a timeout is probably a good thing.

@ncdc
Copy link
Member

ncdc commented Jul 12, 2016

In the environments where we've seen this happen, it seems to hang for a long time

@derekwaynecarr
Copy link
Member Author

#28871 improves the situation, but does not absolve it completely. Either way, from a code hygiene standpoint we should never allow the use of http.DefaultClient in the project. I would like to still see this merged if there are no objections.

@derekwaynecarr
Copy link
Member Author

To elaborate, the credential provider is still used to make other remote calls that are not being protected with any timeout, or use the default transport requirements consistent with rest of project.

@ncdc ncdc added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2016
@ncdc ncdc assigned ncdc and unassigned erictune Jul 22, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 22, 2016

GCE e2e build/test passed for commit 5366bfe.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jul 23, 2016

GCE e2e build/test passed for commit 5366bfe.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 75689dd into kubernetes:master Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants