Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment on sleep during graceful shutdown #320

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/signals/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func (s *Shutdown) Graceful(stopCh <-chan struct{}, httpServer *http.Server, htt

s.logger.Info("Shutting down HTTP/HTTPS server", zap.Duration("timeout", s.serverShutdownTimeout))

// wait for Kubernetes readiness probe to remove this instance from the load balancer
// There could be a period where a terminating pod may still receive requests. Implementing a brief wait can mitigate this.
// See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination
// the readiness check interval must be lower than the timeout
if viper.GetString("level") != "debug" {
time.Sleep(3 * time.Second)
Expand Down