net/http: Server.Shutdown doc example bug: no exit on error #30641
Labels
Comments
Ok, so you are talking about cases where the listener returns on its own without calling Let's see what @bradfitz says. |
That's correct. My included reproduction shows a case where a bad address was provided so the listener fails immediately. But it won't exit because its waiting on the graceful shutdown channel, which never gets touched. |
@bradfitz thoughts ? |
Fixed with 04e2e81 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It appears the doc example that is provided for
http.Server.Shutdown
has a bug.https://godoc.org/net/http#Server.Shutdown
The example shows that when the listener returns, it only prints the error as opposed to being fatal. This would cause the process to block on the done channel until SIGINT is actually sent.
Reproduction of bug:
https://play.golang.org/p/LCSLoMWIMrR
Should the error handling use
log.Fatal
?The text was updated successfully, but these errors were encountered: