-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Automated cherry pick of #100959: DelegatingAuthenticationOptions TokenReview request timeout #101103
Automated cherry pick of #100959: DelegatingAuthenticationOptions TokenReview request timeout #101103
Conversation
it turns out that setting a timeout on HTTP client affect watch requests made by the delegated authentication component. with a 10 second timeout watch requests are being re-established exactly after 10 seconds even though the default request timeout for them is ~5 minutes. this is because if multiple timeouts were set, the stdlib picks the smaller timeout to be applied, leaving other useless. for more details see https://github.com/golang/go/blob/a937729c2c2f6950a32bc5cd0f5b88700882f078/src/net/http/client.go#L364 instead of setting a timeout on the HTTP client we should use context for cancellation.
/kind bug |
/retest |
/approve |
/retest |
/lgtm |
/approve |
/triage accepted |
This resolves a significant load problem. /priority important-soon |
/kind regression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, dims, p0lyn0mial, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubernetes-bazel-test |
/test pull-kubernetes-e2e-kind |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
/test pull-kubernetes-e2e-kind |
/retest Review the full test history for this PR. Silence the bot with an |
4 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
Cherry pick of #100959 on release-1.20.
#100959: DelegatingAuthenticationOptions TokenReview request timeout
For details on the cherry pick process, see the cherry pick requests page.
What type of PR is this?
/kind bug
What this PR does / why we need it:
It turns out that setting a timeout on HTTP client affects watch requests made by the delegated authentication component.
With a 10 second timeout watch requests are being re-established exactly after 10 seconds even though the default request timeout for them is ~5 minutes.
This is because if multiple timeouts were set, the stdlib picks the smaller timeout to be applied, leaving others useless.
For more details see https://github.com/golang/go/blob/a937729c2c2f6950a32bc5cd0f5b88700882f078/src/net/http/client.go#L364
Instead of setting a timeout on the HTTP client, we should use context for cancellation.
This has the potential of being scattered across the codebase, perhaps we should seek a broader solution.
Here is a reproducer for re-establish watch requests when
http.Client.Timeout
is set with standardclient-go
libraryp0lyn0mial/simple-watch#2
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: