Skip to content

Commit

Permalink
fix context cause.
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Oct 12, 2023
1 parent 4abfb0a commit 4c8ca30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cdc/sink/dmlsink/mq/mq_dml_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ func newDMLSink(
s.alive.Unlock()
close(s.dead)

if err != nil && errors.Cause(err) != context.Canceled {
if err == nil {
return
}

if context.Cause(ctx) != nil {
select {
case <-ctx.Done():
case errCh <- err:
case errCh <- ctx.Err():
}
}
}()
Expand Down

0 comments on commit 4c8ca30

Please sign in to comment.