From 80abc172d04385f5c43585321ffec79165b91665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=97=BA?= Date: Tue, 14 Mar 2023 17:31:03 +0800 Subject: [PATCH] fix crash when adjusting partition number --- producer/TalosProducer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/producer/TalosProducer.go b/producer/TalosProducer.go index e803800..ed43bb0 100644 --- a/producer/TalosProducer.go +++ b/producer/TalosProducer.go @@ -540,6 +540,8 @@ func (p *TalosProducer) DescribeTopicInfo() (*topic.TopicTalosResourceName, int3 } func (c *TalosProducer) ProducerMonitorTask() { + c.producerLock.Lock() + defer c.producerLock.Unlock() metrics := make([]*utils.FalconMetric, 0) for _, p := range c.partitionSenderMap { metrics = append(metrics, p.NewFalconMetrics()...)