mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-13 17:14:05 -08:00
Scraping: drop series cache when resizing symbol table
Clear caches by restarting scraping loops: each loop assumes it has exclusive ownership of its cache, so we can't come in from another goroutine and change it. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
74b1f3daa6
commit
e6356e64bd
|
@ -376,6 +376,7 @@ func (sp *scrapePool) checkSymbolTable() {
|
||||||
} else if sp.symbolTable.Len() > 2*sp.initialSymbolTableLen {
|
} else if sp.symbolTable.Len() > 2*sp.initialSymbolTableLen {
|
||||||
sp.symbolTable = labels.NewSymbolTable()
|
sp.symbolTable = labels.NewSymbolTable()
|
||||||
sp.initialSymbolTableLen = 0
|
sp.initialSymbolTableLen = 0
|
||||||
|
sp.restartLoops(false) // To drop all caches.
|
||||||
}
|
}
|
||||||
sp.lastSymbolTableCheck = time.Now()
|
sp.lastSymbolTableCheck = time.Now()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue