Browse Source

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>
pull/14328/head
Bryan Boreham 8 months ago
parent
commit
e6356e64bd
  1. 1
      scrape/scrape.go

1
scrape/scrape.go

@ -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…
Cancel
Save