mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Prevent an indexing death spiral.
Change-Id: I86b20cd0830d02f87b2f020767257e2d3fb2033c
This commit is contained in:
parent
40354eaa29
commit
95f392fb2c
|
@ -824,7 +824,11 @@ loop:
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case <-batchTimeout.C:
|
case <-batchTimeout.C:
|
||||||
if batchSize > 0 {
|
// Only commit if we have something to commit _and_
|
||||||
|
// nothing is waiting in the queue to be picked up. That
|
||||||
|
// prevents a death spiral if the LookupSet calls below
|
||||||
|
// are slow for some reason.
|
||||||
|
if batchSize > 0 && len(p.indexingQueue) == 0 {
|
||||||
commitBatch()
|
commitBatch()
|
||||||
} else {
|
} else {
|
||||||
batchTimeout.Reset(indexingBatchTimeout)
|
batchTimeout.Reset(indexingBatchTimeout)
|
||||||
|
|
Loading…
Reference in a new issue