Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix net/http caching of broken persistent connections
The net/http transport code is currently broken, it keeps broken persistent connections in the cache if a write error happens during h2 handshake. This is documented in the upstream bug at: golang/go#40213 The problem occurs because in the "go" compiler the http2 code is imported into http as a bundle, with an additional "http2" prefix applied. This messes up the erringRoundTripper handling because the name doesn't match. The solution is to have the "go" compiler look for an interface instead, so we add a new dummy function that doesn't actually do anything and then the "go" compiler can check whether the specified RoundTripper implements the dummy function. This is slightly different from the proposed upstream fixes for the above upstream bug, it more closely follows how the equivalent problem was solved by IsHTTP2NoCachedConnError(). Change-Id: Ia6e91acb15ff4fe996c8ea9b8a1032cede6c4aab Partial-Bug: 1887438 Signed-off-by: Chris Friesen <[email protected]>
- Loading branch information