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

set timeout for bucket HEAD client #208

Merged
merged 1 commit into from
Apr 18, 2023
Merged

Conversation

BenTheElder
Copy link
Member

depends on #206

I haven't seen evidence that this is a problem yet, but it seems obviously problematic by inspection.

There is no default timeout on http.Client. We made a similar change for the listener.

It's possible to do more granular timeouts over e.g. dialing the connection, and other tuning, but this seems like the most important and simplest change.

/hold

Not sure if this counts as a bugfix ref: #181 as currently in practice we have very good response times and haven't seen this issue yet ... but it seems bound to happen.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 26, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2023
Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

@TerryHowe: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, TerryHowe

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ameukam
Copy link
Member

ameukam commented Mar 27, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2023
@aojea
Copy link
Member

aojea commented Mar 27, 2023

/lgtm

func newHTTPClient() *http.Client {
// ensure sensible timeouts
// this client will be used to make HEAD calls
return &http.Client{
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: transport and connection reuse tuning, given the large amount of calls to same-host?

Copy link
Member

Choose a reason for hiding this comment

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

so you reuse the same http client?

Copy link
Member Author

Choose a reason for hiding this comment

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

we do, and that will implicitly use http.DefaultTransport
http client transport can be tuned for connection idle + reuse

Copy link
Member Author

Choose a reason for hiding this comment

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

client reuse may actually be suboptimal (locks on shared resources like cookies etc) vs just ensuring transport reuse and tuning that.

Most advice about client re-use seems to be either related to transport reuse (which can instead be accomplished by passing a transport when constructing a client) or maybe allocation (not a primary concern here).

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2023
@BenTheElder
Copy link
Member Author

rebased
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2023
@ameukam
Copy link
Member

ameukam commented Apr 18, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 18, 2023
@k8s-ci-robot k8s-ci-robot merged commit e9c6c92 into kubernetes:main Apr 18, 2023
@BenTheElder BenTheElder deleted the cache branch April 18, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

5 participants