Skip to content

Commit

Permalink
sink: when context is done, send to chan will be block (pingcap#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored May 15, 2020
1 parent e1951b5 commit 0f8a7d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cdc/sink/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,11 @@ func concurrentExec(
sendFn := func(rows []*model.RowChangedEvent, keys []string, idx int) {
causality.add(keys, idx)
jobWg.Add(1)
rowsChs[idx] <- rows
select {
case <-ctx.Done():
jobWg.Done()
case rowsChs[idx] <- rows:
}
}
for groupKey, multiRows := range rowGroups {
for _, rows := range multiRows {
Expand Down

0 comments on commit 0f8a7d2

Please sign in to comment.