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 allows wrapped handlers crash server with panics #22084
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
What did you expect to see?
I expect panics from http.Handlers to be handled by http.Server as documented (recovered), i.e. with the sentinel panic value http.ErrAbortHandler this program outputs something like this:
What did you see instead?
This happens because TimeoutHandler starts original handler in a separate goroutine:
I can work on fixing this by handling panic in this goroutine and re-raising it from the