Description
What version of Go are you using (go version
)?
$ go version go version go1.14.4 linux/amd64
Does this issue reproduce with the latest release?
Yes, following code on golang/net master branch.
What operating system and processor architecture are you using (go env
)?
not relevant
What did you do?
golang/net#55 brought a new feature in golang's http2 implementation that allows early detection of broken network connections. Setting this seems to resolve potentially several rare issues we're facing in production every now and then.
Now, most clients use the (I think also recommended?) way to instantiate an http.Transport
, which is then "upgraded" to http2 capabilities. For example, in prometheus/common:
var rt http.RoundTripper = &http.Transport{
// ...
}
err := http2.ConfigureTransport(rt.(*http.Transport))
or they set Transport.ForceAttemptHTTP2 = true
.
Both ways entirely hide the http2 transport, and I do not see a way to configure http2.Transport.ReadIdleTimeout
/http2.Transport.PingTimeout
.
This also seems to affect k8s.io/apimachinery/pkg/util/net/http.go
, where this golang feature is best bet so far to resolve kubernetes/kubernetes#87615 (it seems to me golang/net#55 was specifically build because of the Kubernetes issue). golang/net#74 proposes an interface to set those values and would resolve this issue.
What did you expect to see?
A possibility to configure http2.Transport
from http.Transport
where needed, for example by passing in an http2.Transport
into the ConfigureTransport
function?
What did you see instead?
No way to configure http2.Transport
settings.