From 7e99b233e27d595076d6d68aa6a2521bd4426330 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 d8fe20f64..fe1b889c2 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -1770,7 +1770,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) }()