From 4bd1de4a608eb22da15c8f9f6ade8bbba7e3a30b Mon Sep 17 00:00:00 2001 From: Luke Addison Date: Sun, 3 Dec 2023 14:02:16 +0000 Subject: [PATCH] Address comments --- pkg/webhook/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/webhook/server.go b/pkg/webhook/server.go index 7a3c585ae1..21bc9a2041 100644 --- a/pkg/webhook/server.go +++ b/pkg/webhook/server.go @@ -251,9 +251,13 @@ func (s *DefaultServer) Start(ctx context.Context) error { go func() { <-ctx.Done() log.Info("Shutting down webhook server with timeout of 1 minute") - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) defer cancel() + // Disable HTTP keep-alives to close persistent connections after next + // HTTP request. Clients may reconnect until routes are updated and + // server listeners are closed however this should start gradually + // migrating clients to server instances that are not about to shutdown + srv.SetKeepAlivesEnabled(false) // Wait for the specified shutdown delay or until the shutdown context // expires, whichever happens first select {