Description
Currently, the http.Transport
implementation will reuse an HTTP connection if keepalives are enabled and the connection has not been in an idle state for too long.
This means that for high throughput connections that are always active and rarely/never exceed the IdleConnTimeout
limit, the connection will keep getting reused (as long as it is not broken).
This poses a problem in terms of service discovery and client-side load balancing - since address resolution only happens in the dialer's DialContext
, this leaves no chance for the client to re-resolve the target address since the same connection is constantly reused without ever "re-dialing".
I propose to add a MaxConnectionAge
flag to http.Transport
that would limit the lifetime of a persistent connection, and would not reuse it beyond this lifetime.
This would be in line with the behavior of go-grpc
which also enforces a MaxConnectionAge
limit.
Metadata
Metadata
Assignees
Type
Projects
Status