Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticdc/processor: don't close error channel in receiver #3414

Merged
merged 3 commits into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cdc/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ func (p *processor) lazyInitImpl(ctx cdcContext.Context) error {
ctx, cancel := cdcContext.WithCancel(ctx)
p.cancel = cancel

// We don't close this error channel, since it is only safe to close channel
// in sender, and this channel will be used in many modules including sink,
// redo log manager, etc. Let runtime GC to recycle it.
errCh := make(chan error, 16)
p.wg.Add(1)
go func() {
Expand All @@ -236,7 +239,6 @@ func (p *processor) lazyInitImpl(ctx cdcContext.Context) error {
for {
select {
case <-ctx.Done():
close(errCh)
return
case err := <-errCh:
if err == nil {
Expand Down