From 0da66c370437b134a8d20acb184e71708f4822aa Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Fri, 10 Feb 2023 13:33:59 +0800 Subject: [PATCH] util/gpool/spmc: add a sleep to a simple `for` (#41240) (#41260) close pingcap/tidb#41205 --- util/gpool/spmc/spmcpool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/util/gpool/spmc/spmcpool.go b/util/gpool/spmc/spmcpool.go index d1a3bbb80c4aa..8afdf9db0c253 100644 --- a/util/gpool/spmc/spmcpool.go +++ b/util/gpool/spmc/spmcpool.go @@ -249,6 +249,7 @@ func (p *Pool[T, U, C, CT, TF]) ReleaseAndWait() { if p.Running() == 0 && p.heartbeatDone.Load() && p.waitingTask.Load() == 0 { return } + time.Sleep(5 * time.Millisecond) } }