From d030288b2a7058e6ffcbd4fb30548f5b1a36bba3 Mon Sep 17 00:00:00 2001 From: "Robert Kent Jr." Date: Thu, 8 Oct 2026 18:25:09 -0400 Subject: [PATCH] Derive the shutdown deadline from the run context --- internal/gateway/gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go index c8dda7a..8ceae5c 100644 --- a/internal/gateway/gateway.go +++ b/internal/gateway/gateway.go @@ -217,7 +217,7 @@ func (g *Gateway) Run(ctx context.Context) error { g.m.draining.Store(true) g.log.Info("draining", "drain_delay", g.cfg.DrainDelay.String()) time.Sleep(g.cfg.DrainDelay) - sctx, cancel := context.WithTimeout(context.Background(), g.cfg.ShutdownTimeout) + sctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), g.cfg.ShutdownTimeout) defer cancel() err = srv.Shutdown(sctx) _ = admin.Shutdown(sctx)