From 6f0cd50dc04cb3b51a0fbe31035a823ad137c3da Mon Sep 17 00:00:00 2001 From: Amir Alavi Date: Sun, 26 Nov 2023 14:17:23 -0500 Subject: [PATCH] fix: revert defer of context done --- cmd/descheduler/app/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/descheduler/app/server.go b/cmd/descheduler/app/server.go index 90d17c8df7..3056a25fa3 100644 --- a/cmd/descheduler/app/server.go +++ b/cmd/descheduler/app/server.go @@ -78,7 +78,6 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command { secureServing.DisableHTTP2 = !s.EnableHTTP2 ctx, done := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) - defer done() pathRecorderMux := mux.NewPathRecorderMux("descheduler") if !s.DisableMetrics { @@ -98,6 +97,7 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command { return err } + done() // wait for metrics server to close <-stoppedCh