From 09eb9aaed57739e07cffbf9bc30c3ecb8b15f649 Mon Sep 17 00:00:00 2001 From: Aaron Son Date: Mon, 15 May 2023 13:58:14 -0700 Subject: [PATCH] go: sqle: cluster: Only close successChs when we are actually caught up. --- go/libraries/doltcore/sqle/cluster/commithook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/libraries/doltcore/sqle/cluster/commithook.go b/go/libraries/doltcore/sqle/cluster/commithook.go index 475a9fc180..1889257f4e 100644 --- a/go/libraries/doltcore/sqle/cluster/commithook.go +++ b/go/libraries/doltcore/sqle/cluster/commithook.go @@ -157,13 +157,13 @@ func (h *commithook) replicate(ctx context.Context) { if h.waitNotify != nil { h.waitNotify() } - if len(h.successChs) != 0 { + if len(h.successChs) != 0 && h.isCaughtUp() { for _, ch := range h.successChs { close(ch) } h.successChs = nil + h.circuitBreakerOpen = false } - h.circuitBreakerOpen = false h.cond.Wait() lgr.Tracef("cluster/commithook: background thread: woken up.") }