Merge pull request #3252 from LK4D4/proper_reset

[storage/local] fix timer.Reset usage
This commit is contained in:
Björn Rabenstein 2017-10-06 13:31:07 +02:00 committed by GitHub
commit a5412cfc59

View file

@ -998,7 +998,8 @@ func (s *MemorySeriesStorage) logThrottling() {
for {
select {
case <-s.throttled:
if !timer.Reset(time.Minute) {
if !timer.Stop() {
<-timer.C
score, _ := s.getPersistenceUrgencyScore()
log.
With("urgencyScore", score).
@ -1006,6 +1007,7 @@ func (s *MemorySeriesStorage) logThrottling() {
With("memoryChunks", atomic.LoadInt64(&chunk.NumMemChunks)).
Error("Storage needs throttling. Scrapes and rule evaluations will be skipped.")
}
timer.Reset(time.Minute)
case <-timer.C:
score, _ := s.getPersistenceUrgencyScore()
log.