diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2022-07-25 10:39:59 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2022-07-25 10:39:59 -0600 |
commit | 0bebea0d4c0321b9cd59be4b355020a3e28c0bcd (patch) | |
tree | 20bca93dc48d8d5d68757fd7eea8083a2e02a983 /modules | |
parent | a379fa4c6c5d58aa6b812bb21a879ce0944c1ccb (diff) |
caddyhttp: Log shutdown errors, don't return (fix #4908)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/app.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go index 4a8a375..1894a97 100644 --- a/modules/caddyhttp/app.go +++ b/modules/caddyhttp/app.go @@ -415,19 +415,21 @@ func (app *App) Stop() error { ctx, cancel = context.WithTimeout(ctx, time.Duration(app.GracePeriod)) defer cancel() } - for _, s := range app.servers { - err := s.Shutdown(ctx) - if err != nil { - return err + for i, s := range app.servers { + if err := s.Shutdown(ctx); err != nil { + app.logger.Error("server shutdown", + zap.Error(err), + zap.Int("index", i)) } } - for _, s := range app.h3servers { + for i, s := range app.h3servers { // TODO: CloseGracefully, once implemented upstream // (see https://github.com/lucas-clemente/quic-go/issues/2103) - err := s.Close() - if err != nil { - return err + if err := s.Close(); err != nil { + app.logger.Error("HTTP/3 server shutdown", + zap.Error(err), + zap.Int("index", i)) } } return nil |