mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Fix leak of ticker in remote storage queue manager.
This commit is contained in:
parent
5ee07b3b3a
commit
73dc96e7f5
1
Makefile
1
Makefile
|
@ -29,7 +29,6 @@ endif
|
||||||
STATICCHECK_IGNORE = \
|
STATICCHECK_IGNORE = \
|
||||||
github.com/prometheus/prometheus/discovery/kubernetes/node.go:SA1019 \
|
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/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/textparse/lex.l.go:SA4006 \
|
||||||
github.com/prometheus/prometheus/pkg/pool/pool.go:SA6002 \
|
github.com/prometheus/prometheus/pkg/pool/pool.go:SA6002 \
|
||||||
github.com/prometheus/prometheus/promql/engine.go:SA6002 \
|
github.com/prometheus/prometheus/promql/engine.go:SA6002 \
|
||||||
|
|
|
@ -293,10 +293,11 @@ func (t *QueueManager) Stop() {
|
||||||
func (t *QueueManager) updateShardsLoop() {
|
func (t *QueueManager) updateShardsLoop() {
|
||||||
defer t.wg.Done()
|
defer t.wg.Done()
|
||||||
|
|
||||||
ticker := time.Tick(shardUpdateDuration)
|
ticker := time.NewTicker(shardUpdateDuration)
|
||||||
|
defer ticker.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ticker:
|
case <-ticker.C:
|
||||||
t.calculateDesiredShards()
|
t.calculateDesiredShards()
|
||||||
case <-t.quit:
|
case <-t.quit:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue