mirror of https://github.com/prometheus/prometheus
Merge pull request #459 from prometheus/beorn7/fix-deadlock
Remove a deadlock during shutdown.pull/463/head
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