From 9369a005576c55aa2f96db4f9d8ced1882a0f3eb Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Tue, 17 Nov 2020 06:27:12 -0800 Subject: [PATCH] x/simulation: make signals channel buffered to avoid missing signals (#7952) Invoking: c := make(chan os.Signal) signal.Notify(c, signals...) is explicitly called out as a bug in the os/signal docs and should instead make that channel buffered lest a signal could be lost. Fixes #7950 Co-authored-by: Aleksandr Bezobchuk --- x/simulation/simulate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index 7767cbbe50..fdcf224611 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -102,7 +102,7 @@ func SimulateFromSeed( opCount := 0 // Setup code to catch SIGTERM's - c := make(chan os.Signal) + c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) go func() {