From 472baaf4e40477d3373e949f174581440c285699 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 10 Dec 2024 16:08:02 +0800 Subject: [PATCH] metrics/influxdb: fix time ticker leaks (#26507) --- metrics/influxdb/influxdbv2.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metrics/influxdb/influxdbv2.go b/metrics/influxdb/influxdbv2.go index 583a1ebc78e0..4fa0d02bcdca 100644 --- a/metrics/influxdb/influxdbv2.go +++ b/metrics/influxdb/influxdbv2.go @@ -62,6 +62,9 @@ func (r *v2Reporter) run() { intervalTicker := time.NewTicker(r.interval) pingTicker := time.NewTicker(time.Second * 5) + defer intervalTicker.Stop() + defer pingTicker.Stop() + for { select { case <-intervalTicker.C: