fix: Close leaked health check kafka producer (#37728)

Related to #36822

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-11-16 11:20:32 +08:00 committed by GitHub
parent 3f7352f3cf
commit 4820dd76e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {