From 73dc96e7f543d55c1600098617390eaba31dd938 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Mon, 9 Oct 2017 17:36:20 +0100 Subject: [PATCH] Fix leak of ticker in remote storage queue manager. --- Makefile | 1 - storage/remote/queue_manager.go | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a280e5ea5..00c3bf248 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,6 @@ endif STATICCHECK_IGNORE = \ github.com/prometheus/prometheus/discovery/kubernetes/node.go:SA1019 \ github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/main.go:SA1019 \ - github.com/prometheus/prometheus/storage/remote/queue_manager.go:SA1015 \ github.com/prometheus/prometheus/pkg/textparse/lex.l.go:SA4006 \ github.com/prometheus/prometheus/pkg/pool/pool.go:SA6002 \ github.com/prometheus/prometheus/promql/engine.go:SA6002 \ diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 1c2feaf91..3f5e59338 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -293,10 +293,11 @@ func (t *QueueManager) Stop() { func (t *QueueManager) updateShardsLoop() { defer t.wg.Done() - ticker := time.Tick(shardUpdateDuration) + ticker := time.NewTicker(shardUpdateDuration) + defer ticker.Stop() for { select { - case <-ticker: + case <-ticker.C: t.calculateDesiredShards() case <-t.quit: return