mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 06:07:11 +02:00
Make sure LeveledCompactor respect context cancellation during the time opening blocks (#16407)
Signed-off-by: Alex Le <leqiyue@amazon.com>
This commit is contained in:
parent
10b4e1b231
commit
701d13abf9
@ -470,6 +470,12 @@ func (c *LeveledCompactor) CompactWithBlockPopulator(dest string, dirs []string,
|
||||
start := time.Now()
|
||||
|
||||
for _, d := range dirs {
|
||||
select {
|
||||
case <-c.ctx.Done():
|
||||
return nil, c.ctx.Err()
|
||||
default:
|
||||
}
|
||||
|
||||
meta, _, err := readMetaFile(d)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user