mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 03:45:41 +03:00
Use cleanhttp.DefaultPooledTransport for the default API client (#12409)
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
1e47e3c82b/api/api.go (L397)
This commit is contained in:
3
.changelog/12409.txt
Normal file
3
.changelog/12409.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
api: default to using DefaultPooledTransport client to support keep-alive by default
|
||||
```
|
||||
@@ -264,7 +264,7 @@ func (t *TLSConfig) Copy() *TLSConfig {
|
||||
}
|
||||
|
||||
func defaultHttpClient() *http.Client {
|
||||
httpClient := cleanhttp.DefaultClient()
|
||||
httpClient := cleanhttp.DefaultPooledClient()
|
||||
transport := httpClient.Transport.(*http.Transport)
|
||||
transport.TLSHandshakeTimeout = 10 * time.Second
|
||||
transport.TLSClientConfig = &tls.Config{
|
||||
|
||||
Reference in New Issue
Block a user