Skip to content

Commit c897252

Browse files
http3: client support for graceful shutdown (#91)
* http3: client support for graceful shutdown As of quic-go v0.52.0, HTTP/3 graceful shutdown is now fully implemented for both the client and the server. * reword long sentence Co-authored-by: Copilot <[email protected]> * fix grammar * formatting of error code --------- Co-authored-by: Copilot <[email protected]>
1 parent a05cb74 commit c897252

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

content/docs/http3/server.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,17 @@ func(w http.ResponseWriter, r *http.Request) {
118118

119119
## Graceful Shutdown
120120

121-
The `http3.Server` can be gracefully closed by calling the `Shutdown`. The server then stops accepting new connections. Existing connections are served until all active requests have completed.
121+
The `http3.Server` can be gracefully closed by calling the `Shutdown` method. The server then stops accepting new connections and new requests, but allows existing requests to finish.
122122

123123
```go
124124
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
125125
defer cancel()
126126
server.Shutdown(ctx)
127127
```
128128

129-
On the wire, graceful shutdown is signaled by sending a GOAWAY frame. This tells clients that the server will not accept any new requests. Clients are expected to finish processing existing requests and then close the QUIC connection.
129+
On the wire, graceful shutdown is signaled by sending a GOAWAY frame. This tells clients that the server will not accept any new requests. Requests received after sending the GOAWAY frame are rejected (using the `H3_REQUEST_REJECTED` error code). Existing connections are not closed; clients are expected to close them after they finish processing their requests.
130130

131-
{{< callout type="info" >}}
132-
Client behavior for handling GOAWAY frames is currently not implemented in quic-go yet, see [#153](https://github.com/quic-go/quic-go/issues/153).
133-
{{< /callout >}}
134-
135-
`Shutdown` returns when all active requests have been served, or when the context is canceled. In that case, all remaining active QUIC connections are closed, which abruptly terminates the remaining requests.
136-
137-
{{< callout type="warning" >}}
138-
As noted above, it is the caller's responsibility to close QUIC connections passed to `ServeQUICConn`. `Shutdown` sends the GOAWAY frame on these connections, but it doesn't close them. However, `Shutdown` blocks until these connections are closed.
139-
{{< /callout >}}
131+
`Shutdown` returns when all existing connections have been closed, or when the context is canceled. In that case, all remaining active QUIC connections are closed, which abruptly terminates the remaining requests.
140132

141133

142134
## 📝 Future Work

0 commit comments

Comments
 (0)