Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: Shutdown method on http server not working properly when using h2 proto in tls config #33191
What version of Go are you using (
Debugs on both sides show proper shutdown.
Client side (nghttp)
I made a new test on a different machine.
And i still got a different behavior between h2 and http/1.1.
When using h2 I got EOF. And when using http/1.1 I got the PID.
I sent a SIGTERM before the request was complete.
cURL output with http:
cURL output with http2:
@fraenkel this is exactly a bug described by OP, server send GOAWAY without waiting for handlers to finish.
Actually, I am not convinced any client is sending a GOAWAY. From the traces and from additional debug, the server receives an EOF rather than any more messages to finish the request.
If you do a trace of a clean GET, you will notice that the client does not wait for the GOAWAY from the server.
Ok, I found some problems:
The graceful shutdown works as expected but curl will complain about malformed HTTP2 frames, and maybe this is bug in curl, because I don't see any wrong HTTP2 packets in Wireshark.
I don't get any error messages, also found this: https://bugzilla.redhat.com/show_bug.cgi?id=1690971
HTTP2 is hard :(