-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: closeNotify does not work well when read timeout is set #9524
Comments
Too late for Go 1.5. |
Any update on that? We have Go 1.7 and this is still not fixed. We just lost one day investigating the bug which was caused by the
The above is not true while using Surprisingly, the Any plans for this bug? |
A lot of work happened in this space in Go 1.8. Notably, I lost this bug because it fell into the "Unplanned" milestone, which we no longer use. I'll retarget this for Go 1.9. But it might also be fixed by the Go 1.8 changes. Can you investigate using Go 1.8beta2? See https://groups.google.com/forum/#!topic/golang-nuts/5YvvkQjJJW0 for details.
|
Thanks, will try in the next days. |
CL https://golang.org/cl/34515 mentions this issue. |
@bradfitz: I can confirm that I can reproduce this issue on I dived even deeper into the code and used this occasion to start my contribution to Go ! (: Sorry that I did not discuss the change before doing the CL, but maybe it will be easier to iterate over the initial attempt: https://go-review.googlesource.com/#/c/34515/ The main problem is that even the updated description is not entirely true:
Reading the whole body does not reset the ReadTimeout Deadline. ReadTimeout Deadline is being reset (or replaced by IdleTimeout) in the very end of the Any ideas or feedback? Naturally, I am new to the Go contribution and |
I think this was fixed between Go 1.8beta2 and Go 1.8rc1 in https://go-review.googlesource.com/34813 while fixing #18447. @Bplotka, @xiang90, could either of you two confirm? |
Yes, it seems that the issue is fixed in Go 1.8rc1 |
@bradfitz, @Bplotka confirmed it.
|
The original issue is fixed on tip. |
Shall I close this issue? @bradfitz |
ref. golang/go#9524 (comment) Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
ref. golang/go#9524 (comment) Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
There is a read timeout configuration for http server:
I expect it is the timeout for finishing reading the request only.
When read timeout is set, the connection will be considered as closed after the timeout even if the connection is still open and working. The following code set up a http server with read timeout and a handler simply blocks forever until closeNotify fires.
I expect to see the hander blocks "forever", but it unblocks after the read timeout.
The closeNotifiy depends on the read of the underlying connection. Shall we cancel the read timeout after finishing reading the request?
The text was updated successfully, but these errors were encountered: