You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
net/http: canceled requests with Timeout set always return a Timeout error #16094
If the cause was not a Client.Timeout, then the error should be left alone.
net/http: request canceled
What did you see instead?
The error is
net/http: request canceled (Client.Timeout exceeded while reading body)
This is because reqWasCanceled returns true whatever the reason for the cancelation is, be it a library user cancel or a Timeout. Then cancelTimerBody.Read uses that function to add the message.
The (Client.Timeout exceeded while awaiting headers) message is more likely to be correct (even if slightly racy), because it only adds the message if !deadline.IsZero() && !time.Now().Before(deadline).
Reacted by Andre Voget, Max Vyaznikov, Yandry Pozo, tomj, Waldemar Quevedo, Xianglin Gao, ganelon and vodo22
changed the title [-]Canceled requests with timeout always mention Client.Timeout in the error[/-][+]net/http: canceled requests with timeout always mention Client.Timeout in the error[/+]on Jun 17, 2016
changed the title [-]net/http: canceled requests with timeout always mention Client.Timeout in the error[/-][+]net/http: canceled requests with Timeout set always return a Timeout error[/+]on Jun 17, 2016
Activity
[-]Canceled requests with timeout always mention Client.Timeout in the error[/-][+]net/http: canceled requests with timeout always mention Client.Timeout in the error[/+]FiloSottile commentedon Jun 17, 2016
Looking into it, this is not only the error message. The error is actually a net Timeout.
[-]net/http: canceled requests with timeout always mention Client.Timeout in the error[/-][+]net/http: canceled requests with Timeout set always return a Timeout error[/+]gopherbot commentedon Jun 17, 2016
CL https://golang.org/cl/24230 mentions this issue.
bradfitz commentedon Jun 29, 2016
@FiloSottile, is this a regression from Go 1.6?
FiloSottile commentedon Jun 29, 2016
odeke-em commentedon Nov 1, 2016
I've updated @FiloSottile's CL https://golang.org/cl/24230 with https://go-review.googlesource.com/32478.
gopherbot commentedon Nov 1, 2016
CL https://golang.org/cl/32478 mentions this issue.
KingRider commentedon Jan 26, 2017
go/src/net/http/client.go
Line 301 in 7448eb4
Check L303
https://go-review.googlesource.com/#/c/32478/1/src/net/http/client.go@303
Please is what correct? But a continue problem
bradfitz commentedon Jan 26, 2017
@KingRider, we don't track comments on closed issues. Please file a new bug if you have a reproducible problem with the Go master branch.
keitaj commentedon Mar 6, 2017
Where is
cancelTimerBody.Readused?bradfitz commentedon Mar 6, 2017
@keitaj, we don't track comments on closed issues. Please file a new bug if you have a reproducible problem with the Go master branch.