mirror of
https://github.com/prometheus/prometheus
synced 2025-01-17 04:12:33 +00:00
Merge pull request #459 from prometheus/beorn7/fix-deadlock
Remove a deadlock during shutdown.
This commit is contained in:
commit
f541390dfb
@ -467,18 +467,17 @@ func (s *memorySeriesStorage) handleEvictList() {
|
||||
s.maybeEvict()
|
||||
}
|
||||
case <-s.evictStopping:
|
||||
// Drain evictRequests to not let requesters hang.
|
||||
for {
|
||||
select {
|
||||
case <-s.evictRequests:
|
||||
// Do nothing.
|
||||
default:
|
||||
ticker.Stop()
|
||||
glog.Info("Chunk eviction stopped.")
|
||||
close(s.evictStopped)
|
||||
return
|
||||
// Drain evictRequests forever in a goroutine to not let
|
||||
// requesters hang.
|
||||
go func() {
|
||||
for {
|
||||
<-s.evictRequests
|
||||
}
|
||||
}
|
||||
}()
|
||||
ticker.Stop()
|
||||
glog.Info("Chunk eviction stopped.")
|
||||
close(s.evictStopped)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user