From a7c6e72bea65271895d137072dfc895fe2146559 Mon Sep 17 00:00:00 2001 From: bdchatham Date: Thu, 30 Apr 2026 13:21:45 -0700 Subject: [PATCH] fix: exit 0 on graceful SIGTERM/deadline shutdown Background tasks return ctx.Err() on shutdown, which bubbles to runLoadTest as context.Canceled and is then log.Fatal()'d, so every graceful shutdown exits 1. Treat context.Canceled (and DeadlineExceeded for future-proofing) as the expected end-of-run signal at the process boundary. Fixes KubeJobFailed alerts for nightly/seiload-* on harbor. Co-Authored-By: Claude Opus 4.7 (1M context) --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index bb3f7ab..d382bf6 100644 --- a/main.go +++ b/main.go @@ -362,6 +362,9 @@ func runLoadTest(ctx context.Context, cmd *cobra.Command, args []string) error { time.Sleep(d) } log.Printf("👋 Shutdown complete") + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + err = nil + } return err }