Skip to content

net/http: HTTP/2 connections incorrectly marked as "reused" #60636

Closed
@neild

Description

@neild

The Transport retry loop checks to see if a request was sent on a fresh connection or a reused one (persistConn.shouldRetryRequest). Requests sent on a fresh connection are not retried, to avoid looping forever if the server is hanging up on the request for some reason.

Connections are marked as reused when added to the idle conn pool (Transport.tryPutIdleConn).

HTTP/2 connections are added to the idle conn pool as soon as they're made, since the connection can be reused for additional HTTP/2 requests while the first is in flight.

Thus, we incorrectly retry requests to an HTTP/2 server that hangs up without giving a response (say, because we sent a malformed request), because HTTP/2 connections are always marked as "reused".

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions