mirror of https://github.com/knative/pkg.git
Disable keep-alives on shutdown. (#1511)
See also: https://github.com/knative/pkg/issues/1509#issuecomment-659737054
This commit is contained in:
parent
25f2aa6443
commit
0f78f8a8cc
|
@ -219,6 +219,9 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
|
||||||
logger.Info("Starting to fail readiness probes...")
|
logger.Info("Starting to fail readiness probes...")
|
||||||
close(wh.stopCh)
|
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
|
// 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.
|
// endpoint to be removed from the webhook service's Endpoints.
|
||||||
// For this to be effective, it must be greater than the probe's
|
// For this to be effective, it must be greater than the probe's
|
||||||
|
|
Loading…
Reference in New Issue