v0.52.0
·
418 commits
to master
since this release
This release focus on HTTP/3 graceful shutdown using the GOAWAY mechnism.
On the server side graceful shutdown is initiated by calling the http3.Server.Shutdown method:
- A single GOAWAY frame is sent, instructing the client to not issue any new requests (#5114).
- New requests are rejected by resetting the streams using the H3_REQUEST_REJECTED reset error code: #5116.
- QUIC listeners created by the HTTP/3 server (i.e. when using
http3.Server.ListenAndServeandListenAndServeTLS) are immediately closed (#5101). QUIC listeners created by the application (i.e. when usinghttp3.Server.ServeListener) are left running, it is the application's responsibility to close them, or use them in a new server instance (#5129). - Note that the during the graceful shutdown period, the server does not close existing connections, as this is racy in the presence of packet reordering.
On the client side, when receiving a GOAWAY frame:
- No new streams will be opened on the new connection. Requests to the same origin will be sent on a freshly established QUIC connection.
- Once all requests have completed / were cancelled, the underlying QUIC connection is closed: #5143 and #5145.
Breaking Changes
Transport.ConnContextnow passes theClientInfoto the callback, and allows rejecting handshakes by introducing anerrorreturn value: #5122. This allows applications to build more sophisticated DoS defenses. Thanks to @sukunrt!- Connections accepted from a
Listenerusing theListenandListenAddrconvenience functions now aren't closed when the listener is closed. This makes the shutdown behavior consistent with listeners created from aTransport, and the standard library'snet.Listener: #5108.
Other Notable Changes
- The TLS ClientHello is now fragmented into multiple pieces, complicating Deep Packet Inspection of the handshake by middlebox: #5107. This behavior can be disabled by setting the
QUIC_GO_DISABLE_CLIENTHELLO_SCRAMBLINGenvironment variable. - Kernel control messages for ECN and for picking the correct network interface now work on big-endian platforms such as s390x: #5094 and #5105. Thanks to @Zxilly!
- The RTT estimate is now stored in the resumption token (and not in the TLS session ticket): #5065. Thanks to @tanghaowillow!
Fixes
- http3: The Alt-Svc entry is now removed when
http3.Server.Servereturns: #5093. - http3:
http3.Server.ServeQUICConnnow returnshttp.ErrServerClosedwhen called on a closed server: #5095. - http3: The datagram receive loop now doesn't prematurely return when receiving a datagram for an unknown stream: #5136.
- http3: Requests are now only retried when it can be guaranteed that the server didn't process the request: #5141.
- http3: Prevent a stream leak when the server sends too many 1xx responses: #5144.
Behind The Scenes
As in the last couple of releases, we continued our ongoing effort to migrate away from the Ginkgo test suite (tracking issue #3652), mostly in the HTTP/3 package: #5068, #5069, #5070, #5073, #5075, #5078, #5067, #5081, #5085, #5096, #5133. There are still ~1400 LOC of Ginkgo tests to clean up, scattered across the code base.
Changelog
- use assert.AnError consistently in tests by @marten-seemann in #5066
- http3: migrate the request writer tests away from Ginkgo by @marten-seemann in #5069
- http3: migrate the headers tests away from Ginkgo by @marten-seemann in #5068
- http3: simplify request writer by writing to an io.Writer by @marten-seemann in #5070
- http3: check response writer for http.ResponseController methods by @marten-seemann in #5071
- http3: migrate the capsule tests away from Ginkgo by @marten-seemann in #5073
- http3: migrate the response writer tests away from Ginkgo by @marten-seemann in #5075
- http3: migrate the datagram tests away from Ginkgo by @marten-seemann in #5076
- http3: migrate the body tests away from Ginkgo by @marten-seemann in #5078
- http3: migrate the frames tests away from Ginkgo by @marten-seemann in #5067
- ackhandler: migrate the packet number generator tests away from Ginkgo by @marten-seemann in #5081
- http3: use httptest.NewRequest by @marten-seemann in #5086
- http3: update
HijackerandHTTPStreamerdocumentation by @TheoTechnicguy in #5089 - http3: use a slice instead of a map to store active listeners by @marten-seemann in #5087
- http3: remove Alt-Svc entry when Server.Serve returns by @marten-seemann in #5093
- http3: return http.ErrServerClosed for ServeQUICConn after Server.Close by @marten-seemann in #5095
- fix: parse ifindex from packet correctly by @Zxilly in #5094
- http3: migrate the server tests away from Ginkgo by @marten-seemann in #5085
- fix dequeuing logic for tiny CRYPTO frames by @marten-seemann in #5104
- remove periodic logging functionality from packet handler map by @marten-seemann in #5110
- delete retired connection IDs after 3 PTOs by @marten-seemann in #5109
- simplify tracking of Transports for connection migration by @marten-seemann in #5111
- ci: set a 30 minute timeout for the interop Docker job by @marten-seemann in #5112
- http3: send GOAWAY frame in a new Goroutine by @marten-seemann in #5114
- ci: also build the interop image on pull requests, but skip pushing by @marten-seemann in #5115
- delete closed connections after 3 PTOs by @marten-seemann in #5117
- http3: reset request streams accepted after graceful shutdown by @marten-seemann in #5116
- ci: bump golangci-lint-action to v8 and golangci-lint to v2.1.6 by @dependabot in #5118
- move connection tracking into the Transport by @marten-seemann in #5113
- ci: remove stray GITREF env from Docker interop workflow by @marten-seemann in #5119
- split SNI and ECH extensions in the ClientHello by @marten-seemann in #5107
- ci: only apply the interop Docker build concurrency group for pushes by @marten-seemann in #5120
- fix ECN control messages on big-endian architectures by @Zxilly in #5105
- remove stray assertion that handshakes are running from tests by @marten-seemann in #5123
- fix race condition in tests when setting the key update interval by @marten-seemann in #5121
- remove the changelog by @marten-seemann in #5074
- never close accepted connections when the listener is closed by @marten-seemann in #5108
- http3: don't close QUIC listeners created by the application by @marten-seemann in #5129
- http3: close QUIC listeners created by Server on graceful shutdown by @marten-seemann in #5101
- use the slices package to simply QUIC version comparisons by @marten-seemann in #5130
- http3: migrate the client tests away from Ginkgo by @marten-seemann in #5096
- http3: keep datagram receive loop running on datagram for unknown stream by @marten-seemann in #5136
- http3: migrate the connection tests away from Ginkgo by @marten-seemann in #5133
- http3: fix flaky TestClientRequestLengthLimit by @marten-seemann in #5137
- fix flaky TestHandshakeCloseListener by @marten-seemann in #5140
- http3: only retry requests for which it is safe to do so by @marten-seemann in #5141
- pass ClientInfo to ConnContext, allow rejecting of handshakes by @sukunrt in #5122
- store the RTT in the token, not in the session ticket by @tanghaowillow in #5065
- http3: reset request stream if the server sends too many 1xx responses by @marten-seemann in #5144
- http3: implement client-side GOAWAY handling by @marten-seemann in #5143
- http3: fix off-by-one error when processing the GOAWAY stream ID by @marten-seemann in #5145
New Contributors
- @TheoTechnicguy made their first contribution in #5089
Full Changelog: v0.51.0...v0.52.0