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 <alexanderbez@users.noreply.github.com>
This commit is contained in:
parent
0647d897f5
commit
9369a00557
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user