Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: HTTP/2 retry loop broken when net/http manages dials #52459

Open
neild opened this issue Apr 21, 2022 · 0 comments
Open

net/http: HTTP/2 retry loop broken when net/http manages dials #52459

neild opened this issue Apr 21, 2022 · 0 comments
Assignees
Labels
NeedsInvestigation
Milestone

Comments

@neild
Copy link
Contributor

@neild neild commented Apr 21, 2022

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.

@thanm thanm added the NeedsInvestigation label Apr 22, 2022
@thanm thanm added this to the Backlog milestone Apr 22, 2022
@neild neild self-assigned this Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants