Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dippynark committed Dec 3, 2023
1 parent 5c3c96e commit 4bd1de4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4bd1de4

Please sign in to comment.