net/http: non-deterministic timeout error with custom transport #51385
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Currently using the latest
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
On a client with a timeout, added a custom transport and
RoundTrip
function. The custom transport causes the timeout error to be non-deterministic, even though it only passes the request through to the default transport.With the default transport, the error is
context deadline exceeded
. With a custom transport, we randomly getcontext deadline exceeded
ornet/http: request canceled
.Test code to reproduce
What did you expect to see?
Expected to deterministically see a
context deadline exceeded
, the same as returned without a custom transport.What did you see instead?
Randomly see either
context deadline exceeded
ornet/http: request canceled
timeout errors.The text was updated successfully, but these errors were encountered: