Skip to content

Commit

Permalink
Merge branch 'master' into enable-new-sched-by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzix authored Mar 11, 2022
2 parents 17517a0 + b3655c8 commit 76fe383
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cdc/sink/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ func (s *mysqlSink) createSinkWorkers(ctx context.Context) error {
}

func (s *mysqlSink) notifyAndWaitExec(ctx context.Context) {
// notifyAndWaitExec may return because of context cancellation,
// and s.flushSyncWg.Wait() goroutine is still running, check context first to
// avoid data race
select {
case <-ctx.Done():
log.Warn("context is done", zap.Error(ctx.Err()))
return
default:
}
s.broadcastFinishTxn()
s.execWaitNotifier.Notify()
done := make(chan struct{})
Expand Down

0 comments on commit 76fe383

Please sign in to comment.