diff --git a/pkg/mq/msgstream/msgstream_util.go b/pkg/mq/msgstream/msgstream_util.go index 903b6cf021fab..7544c4d129e77 100644 --- a/pkg/mq/msgstream/msgstream_util.go +++ b/pkg/mq/msgstream/msgstream_util.go @@ -114,6 +114,7 @@ func KafkaHealthCheck(clusterStatus *pcommon.MQClusterStatus) { clusterStatus.Reason = fmt.Sprintf("failed to create Kafka producer: %v", err) return } + defer producer.Close() metadata, err := producer.GetMetadata(nil, false, 3000) if err != nil {