mirror of
https://github.com/prometheus/prometheus
synced 2026-04-30 23:11:34 +08: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user