mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #459 from prometheus/beorn7/fix-deadlock
Remove a deadlock during shutdown.
This commit is contained in:
commit
f541390dfb
|
@ -467,20 +467,19 @@ func (s *memorySeriesStorage) handleEvictList() {
|
||||||
s.maybeEvict()
|
s.maybeEvict()
|
||||||
}
|
}
|
||||||
case <-s.evictStopping:
|
case <-s.evictStopping:
|
||||||
// Drain evictRequests to not let requesters hang.
|
// Drain evictRequests forever in a goroutine to not let
|
||||||
|
// requesters hang.
|
||||||
|
go func() {
|
||||||
for {
|
for {
|
||||||
select {
|
<-s.evictRequests
|
||||||
case <-s.evictRequests:
|
}
|
||||||
// Do nothing.
|
}()
|
||||||
default:
|
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
glog.Info("Chunk eviction stopped.")
|
glog.Info("Chunk eviction stopped.")
|
||||||
close(s.evictStopped)
|
close(s.evictStopped)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybeEvict is a local helper method. Must only be called by handleEvictList.
|
// maybeEvict is a local helper method. Must only be called by handleEvictList.
|
||||||
|
|
Loading…
Reference in a new issue