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: TimeoutHandler timing out instantly #14568
Please answer these questions before submitting your issue. Thanks!
It looks like the timer of the timoutHandler is created when the handler is wrapped in
…en serving request TimeoutHandler was starting the Timer when the handler was created, instead of when serving a request. It also was sharing it between multiple requests, which is incorrect, as the requests might start at different times. Store the timeout duration and create the Timer when ServeHTTP is called. Different requests will have different timers. The testing plumbing was simplified to store the channel used to control when timeout happens. It overrides the regular timer. Fixes #14568. Change-Id: I4bd51a83f412396f208682d3ae5e382db5f8dc81 Reviewed-on: https://go-review.googlesource.com/20046 Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org> Run-TryBot: Brad Fitzpatrick <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-on: https://go-review.googlesource.com/22274 Reviewed-by: Andrew Gerrand <email@example.com> Run-TryBot: Andrew Gerrand <firstname.lastname@example.org>