diff options
author | WeidiDeng <[email protected]> | 2024-10-16 09:28:20 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-15 21:28:20 -0400 |
commit | c6f2979986d87d7236b132c687c8887c92248dd8 (patch) | |
tree | 82656be2fedeeb47965b7f2ca73dd15c1cfd2af4 /modules/caddyhttp/app.go | |
parent | a211c656f12bcab73df0de114f2b6100ee5a0fe4 (diff) | |
download | caddy-c6f2979986d87d7236b132c687c8887c92248dd8.tar.gz caddy-c6f2979986d87d7236b132c687c8887c92248dd8.zip |
caddyhttp: Close http3 server gracefully (#6213)
* close http3 server gracefully
* update server field
* update from upstream
---------
Co-authored-by: Matt Holt <[email protected]>
Diffstat (limited to 'modules/caddyhttp/app.go')
-rw-r--r-- | modules/caddyhttp/app.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go index 7dc2bee72..cd32e72d7 100644 --- a/modules/caddyhttp/app.go +++ b/modules/caddyhttp/app.go @@ -689,16 +689,7 @@ func (app *App) Stop() error { return } - // First close h3server then close listeners unlike stdlib for several reasons: - // 1, udp has only a single socket, once closed, no more data can be read and - // written. In contrast, closing tcp listeners won't affect established connections. - // This have something to do with graceful shutdown when upstream implements it. - // 2, h3server will only close listeners it's registered (quic listeners). Closing - // listener first and these listeners maybe unregistered thus won't be closed. caddy - // distinguishes quic-listener and underlying datagram sockets. - - // TODO: CloseGracefully, once implemented upstream (see https://github.com/quic-go/quic-go/issues/2103) - if err := server.h3server.Close(); err != nil { + if err := server.h3server.Shutdown(ctx); err != nil { app.logger.Error("HTTP/3 server shutdown", zap.Error(err), zap.Strings("addresses", server.Listen)) |