Skip to content

Commit

Permalink
kafka(ticdc): ddl sink create admin client check error. (#8560)
Browse files Browse the repository at this point in the history
ref #8523
  • Loading branch information
3AceShowHand authored Mar 17, 2023
1 parent 745fe12 commit 51ba7f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cdc/sink/ddlsink/mq/kafka_ddl_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func NewKafkaDDLSink(
}

adminClient, err := factory.AdminClient()
if err != nil {
return nil, cerror.WrapError(cerror.ErrKafkaNewProducer, err)
}
// We must close adminClient when this func return cause by an error
// otherwise the adminClient will never be closed and lead to a goroutine leak.
defer func() {
Expand Down

0 comments on commit 51ba7f3

Please sign in to comment.