From 5b8e30e900b617ee2d74e39676d86dabad09e5eb Mon Sep 17 00:00:00 2001 From: tycho garen Date: Fri, 11 Mar 2022 09:44:31 -0500 Subject: [PATCH] another lock --- internal/consensus/state.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 3d8ecfdef..af12948e1 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -1791,7 +1791,12 @@ func (cs *State) enterPrecommitWait(ctx context.Context, height int64, round int defer func() { // Done enterPrecommitWait: - cs.TriggeredTimeoutPrecommit = true + func() { + cs.mtx.Lock() + defer cs.mtx.Unlock() + + cs.TriggeredTimeoutPrecommit = true + }() cs.newStep(ctx) }()