Skip to content

Commit

Permalink
also pass down max conns per host to consul and nomad http transports
Browse files Browse the repository at this point in the history
Signed-off-by: n-marton <[email protected]>
  • Loading branch information
n-marton committed Sep 24, 2024
1 parent cc8f954 commit 00ca8b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dependency/client_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type CreateConsulClientInput struct {
TransportIdleConnTimeout time.Duration
TransportMaxIdleConns int
TransportMaxIdleConnsPerHost int
TransportMaxConnsPerHost int
TransportTLSHandshakeTimeout time.Duration
}

Expand Down Expand Up @@ -138,6 +139,7 @@ type CreateNomadClientInput struct {
TransportIdleConnTimeout time.Duration
TransportMaxIdleConns int
TransportMaxIdleConnsPerHost int
TransportMaxConnsPerHost int
TransportTLSHandshakeTimeout time.Duration
}

Expand Down Expand Up @@ -184,6 +186,7 @@ func (c *ClientSet) CreateConsulClient(i *CreateConsulClientInput) error {
MaxIdleConns: i.TransportMaxIdleConns,
IdleConnTimeout: i.TransportIdleConnTimeout,
MaxIdleConnsPerHost: i.TransportMaxIdleConnsPerHost,
MaxConnsPerHost: i.TransportMaxConnsPerHost,
TLSHandshakeTimeout: i.TransportTLSHandshakeTimeout,
}

Expand Down Expand Up @@ -416,6 +419,7 @@ func (c *ClientSet) CreateNomadClient(i *CreateNomadClientInput) error {
MaxIdleConns: i.TransportMaxIdleConns,
IdleConnTimeout: i.TransportIdleConnTimeout,
MaxIdleConnsPerHost: i.TransportMaxIdleConnsPerHost,
MaxConnsPerHost: i.TransportMaxConnsPerHost,
TLSHandshakeTimeout: i.TransportTLSHandshakeTimeout,
}

Expand Down
2 changes: 2 additions & 0 deletions manager/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ func NewClientSet(c *config.Config) (*dep.ClientSet, error) {
TransportIdleConnTimeout: config.TimeDurationVal(c.Consul.Transport.IdleConnTimeout),
TransportMaxIdleConns: config.IntVal(c.Consul.Transport.MaxIdleConns),
TransportMaxIdleConnsPerHost: config.IntVal(c.Consul.Transport.MaxIdleConnsPerHost),
TransportMaxConnsPerHost: config.IntVal(c.Consul.Transport.MaxConnsPerHost),
TransportTLSHandshakeTimeout: config.TimeDurationVal(c.Consul.Transport.TLSHandshakeTimeout),
}); err != nil {
return nil, fmt.Errorf("runner: %s", err)
Expand Down Expand Up @@ -1449,6 +1450,7 @@ func NewClientSet(c *config.Config) (*dep.ClientSet, error) {
TransportIdleConnTimeout: config.TimeDurationVal(c.Nomad.Transport.IdleConnTimeout),
TransportMaxIdleConns: config.IntVal(c.Nomad.Transport.MaxIdleConns),
TransportMaxIdleConnsPerHost: config.IntVal(c.Nomad.Transport.MaxIdleConnsPerHost),
TransportMaxConnsPerHost: config.IntVal(c.Nomad.Transport.MaxConnsPerHost),
TransportTLSHandshakeTimeout: config.TimeDurationVal(c.Nomad.Transport.TLSHandshakeTimeout),
}); err != nil {
return nil, fmt.Errorf("runner: %s", err)
Expand Down

0 comments on commit 00ca8b3

Please sign in to comment.