Open
Description
http2.Transport.RoundTripOpt
retries requests under some circumstances (transport.go#492):
for retry := 0; ; retry++ {
cc, err := t.connPool().GetClientConn(req, addr)
if err != nil {
t.vlogf("http2: Transport failed to get client conn for %s: %v", addr, err)
return nil, err
}
// ...
When using the bundled HTTP/2 support in net/http
, however, GetClientConn
does not dial connections when none are available. Instead, it returns ErrNoCachedConn
and net/http
handles the dial.
This results in an infinite retry loop when the server immediately hangs up on a retryable request.