From cd4f46247dcd6843e416a1f4dff38473c50f8a91 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 1 Jul 2022 21:49:40 +0300 Subject: [PATCH] consensus: make double-call to Shutdown a no-op --- pkg/consensus/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index dfdb8539b..8e1b5ad32 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -274,7 +274,7 @@ func (s *service) Start() { // Shutdown implements the Service interface. func (s *service) Shutdown() { - if s.started.Load() { + if s.started.CAS(true, false) { close(s.quit) <-s.finished }