Skip to content

Commit

Permalink
Disable keep-alives on shutdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmoor committed Jul 16, 2020
1 parent 25f2aa6 commit 71db0b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
logger.Info("Starting to fail readiness probes...")
close(wh.stopCh)

// As we start to shutdown, disable keep-alives to avoid clients hanging onto connections.
server.SetKeepAlivesEnabled(false)

// Wait for a grace period for the above to take effect and this Pod's
// endpoint to be removed from the webhook service's Endpoints.
// For this to be effective, it must be greater than the probe's
Expand Down

0 comments on commit 71db0b6

Please sign in to comment.