Skip to content

Commit

Permalink
kv-client(ticdc): evictAllRegions after close receiveEvents goroutine (
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Aug 18, 2023
1 parent 346b526 commit 9c7ae61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions cdc/kv/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ func (s *eventFeedSession) receiveFromStream(
// always create a new region worker, because `receiveFromStream` is ensured
// to call exactly once from outer code logic
worker := newRegionWorker(parentCtx, s.changefeed, s, addr)
defer worker.evictAllRegions()

ctx, cancel := context.WithCancel(parentCtx)
var retErr error
Expand Down
1 change: 0 additions & 1 deletion cdc/kv/region_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ func (w *regionWorker) run() error {
for _, h := range w.handles {
h.Unregister()
}
w.evictAllRegions()
}()
ctx, cancel := context.WithCancel(w.parentCtx)
wg, ctx := errgroup.WithContext(ctx)
Expand Down

0 comments on commit 9c7ae61

Please sign in to comment.