From 51ba7f3b10d42ddba37ea268834680aba7db6d84 Mon Sep 17 00:00:00 2001 From: Ling Jin <7138436+3AceShowHand@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:20:39 +0800 Subject: [PATCH] kafka(ticdc): ddl sink create admin client check error. (#8560) ref pingcap/tiflow#8523 --- cdc/sink/ddlsink/mq/kafka_ddl_sink.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdc/sink/ddlsink/mq/kafka_ddl_sink.go b/cdc/sink/ddlsink/mq/kafka_ddl_sink.go index 97aef1061d3..737d3609753 100644 --- a/cdc/sink/ddlsink/mq/kafka_ddl_sink.go +++ b/cdc/sink/ddlsink/mq/kafka_ddl_sink.go @@ -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() {