Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: Transport.CancelRequest not always called if RoundTrip returns promptly when a request times out #34552
What version of Go are you using (
Why do you expect
Per its documentation:
That seems to also imply that
A version of your test program modified to do so (https://play.golang.org/p/7ZZRvEpy9uJ) seems to confirm that in all cases, either
@bcmills for context, I'm writing tracing middleware that wraps others' arbitrarily old and crusty code, harking back from from versions of Go that do not support context. I don't have much of a say about whether they use CancelRequest or Context cancellation.
Perhaps the docs ought to be clarified? Then again, we've probably spent enough time in this dusty corner. I'll change my test to accommodate.
Thanks both for looking into it.