From 05c9840fc959401c3a9cd03f80b1c7af4f1eda54 Mon Sep 17 00:00:00 2001 From: dongmen <414110582@qq.com> Date: Wed, 6 Mar 2024 13:06:32 +0800 Subject: [PATCH] fix kv client data race panic --- cdc/kv/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cdc/kv/client.go b/cdc/kv/client.go index bfabe91fe9c..0541923ed6c 100644 --- a/cdc/kv/client.go +++ b/cdc/kv/client.go @@ -472,6 +472,7 @@ func (s *eventFeedSession) eventFeed(ctx context.Context) error { }() g, ctx := errgroup.WithContext(ctx) + g.SetLimit(scanRegionsConcurrency) g.Go(func() error { return s.dispatchRequest(ctx) }) @@ -480,8 +481,6 @@ func (s *eventFeedSession) eventFeed(ctx context.Context) error { g.Go(func() error { return s.logSlowRegions(ctx) }) g.Go(func() error { - g, ctx := errgroup.WithContext(ctx) - g.SetLimit(scanRegionsConcurrency) for { select { case <-ctx.Done():