From f9f83e9774e01ea488a788a554cb74c33da9fc13 Mon Sep 17 00:00:00 2001 From: radik878 Date: Wed, 26 Nov 2025 13:40:07 +0200 Subject: [PATCH 1/2] fix: use RunContext with signal-aware root context for graceful shutdown --- cmd/client-stats/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/client-stats/main.go b/cmd/client-stats/main.go index 4c5b582ff698..274bfa66e04d 100644 --- a/cmd/client-stats/main.go +++ b/cmd/client-stats/main.go @@ -1,9 +1,12 @@ package main import ( + "context" "fmt" "os" + "os/signal" runtimeDebug "runtime/debug" + "syscall" "time" "github.com/OffchainLabs/prysm/v7/cmd" @@ -100,7 +103,10 @@ func main() { } }() - if err := app.Run(os.Args); err != nil { + rctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + if err := app.RunContext(rctx, os.Args); err != nil { log.Error(err.Error()) } } From 3106b57670d4f2b887d59454eecebc11aa79f0ea Mon Sep 17 00:00:00 2001 From: radik878 Date: Wed, 26 Nov 2025 13:42:01 +0200 Subject: [PATCH 2/2] Create radik878_fix-clieant-stats-shutdown.md --- changelog/radik878_fix-clieant-stats-shutdown.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/radik878_fix-clieant-stats-shutdown.md diff --git a/changelog/radik878_fix-clieant-stats-shutdown.md b/changelog/radik878_fix-clieant-stats-shutdown.md new file mode 100644 index 000000000000..df7fd152223d --- /dev/null +++ b/changelog/radik878_fix-clieant-stats-shutdown.md @@ -0,0 +1,3 @@ +## Fixed + +- apply RunContext with signal-aware root context for graceful shutdown [#16056](https://github.com/OffchainLabs/prysm/pull/16056)