📝 output log when server shutdown is failed

Kubernetes-commit: dd1300df98682f524a2f028e3b296b3e8783a711
This commit is contained in:
Keisuke Ishigami 2024-11-21 00:58:27 +09:00 committed by Kubernetes Publisher
parent 47024d970a
commit 753940e964
1 changed files with 5 additions and 2 deletions

View File

@ -236,8 +236,11 @@ func RunServer(
defer close(serverShutdownCh)
<-stopCh
ctx, cancel := context.WithTimeout(context.Background(), shutDownTimeout)
server.Shutdown(ctx)
cancel()
defer cancel()
err := server.Shutdown(ctx)
if err != nil {
klog.Errorf("Failed to shutdown server: %v", err)
}
}()
go func() {