-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use cleanhttp.DefaultPooledTransport for the default API client #12409
Conversation
The only difference is DefaultTransport sets DisableKeepAlives This doesn't make much sense to me - every http connection from the nomad client goes to the same NOMAD_ADDR so it's a great case for keep alive. Except round robin DNS and anycast perhaps. Consul does this already https://github.com/hashicorp/consul/blob/1e47e3c82b6eb937baab0688a67cf7ef334ce42c/api/api.go#L397
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. I've added a changelog entry and this will ship in the upcoming Nomad 1.3.0
@benbuzbee just a heads up that I ended up having to revert this in #12480, as the
I'm fairly certain this is a testing artifact and not a real problem with your patch, but I didn't want to hold up the Nomad 1.3.0 beta release while I debugged that. I'll follow-up shortly with a test fix and unrevert the patch so we can ship it in 1.3.0 GA. Thanks for your patience. |
We expect every Nomad API client to use a single connection to any given agent, so take advantage of keep-alive by switching the default transport to `DefaultPooledClient`. Provide a facility to close idle connections for testing purposes. Restores the previously reverted #12409 Co-authored-by: Ben Buzbee <bbuzbee@cloudflare.com>
…12492) We expect every Nomad API client to use a single connection to any given agent, so take advantage of keep-alive by switching the default transport to `DefaultPooledClient`. Provide a facility to close idle connections for testing purposes. Restores the previously reverted #12409 Co-authored-by: Ben Buzbee <bbuzbee@cloudflare.com>
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
The only difference is DefaultTransport sets DisableKeepAlives
This doesn't make much sense to me - every http connection from the
nomad client goes to the same NOMAD_ADDR so it's a great case for keep
alive. Except round robin DNS and anycast perhaps.
Consul does this already
https://github.com/hashicorp/consul/blob/1e47e3c82b6eb937baab0688a67cf7ef334ce42c/api/api.go#L397