Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 16:45 UTC
caddyhttp: Log shutdown errors, don't return (fix #4908)
Matthew Holt committed
Jul 25, 2022 at 10:39 UTC
0bebea0d4c0321b9cd59be4b355020a3e28c0bcd
1 file changed
+10
-8
modules/caddyhttp/app.go
+10
-8
@@ -415,19 +415,21 @@ func (app *App) Stop() error {
415
ctx, cancel = context.WithTimeout(ctx, time.Duration(app.GracePeriod))
416
defer cancel()
417
}
418
- for _, s := range app.servers {
419
- err := s.Shutdown(ctx)
420
- if err != nil {
421
- return err
418
+ for i, s := range app.servers {
419
+ if err := s.Shutdown(ctx); err != nil {
420
+ app.logger.Error("server shutdown",
421
+ zap.Error(err),
422
+ zap.Int("index", i))
423
}
424
}
425
425
- for _, s := range app.h3servers {
426
+ for i, s := range app.h3servers {
427
// TODO: CloseGracefully, once implemented upstream
428
// (see https://github.com/lucas-clemente/quic-go/issues/2103)
428
- err := s.Close()
429
- if err != nil {
430
- return err
429
+ if err := s.Close(); err != nil {
430
+ app.logger.Error("HTTP/3 server shutdown",
431
+ zap.Error(err),
432
+ zap.Int("index", i))
433
}
434
}
435
return nil