Skip to content

Commit 299592b

Browse files
committed
Make sure bucket index load failure will not increase if there is contenxt error
Signed-off-by: Alex Le <[email protected]>
1 parent ea7a076 commit 299592b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/storage/tsdb/bucketindex/loader.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ func (l *Loader) GetIndex(ctx context.Context, userID string) (*Index, Status, e
126126
// (eg. corrupted bucket index or not existing).
127127
l.cacheIndex(userID, nil, ss, err)
128128

129+
if ctx.Err() != nil {
130+
level.Warn(util_log.WithContext(ctx, l.logger)).Log("msg", "received context error when reading bucket index", "err", ctx.Err())
131+
return nil, UnknownStatus, ctx.Err()
132+
}
133+
129134
if errors.Is(err, ErrIndexNotFound) {
130135
level.Warn(l.logger).Log("msg", "bucket index not found", "user", userID)
131136
} else if errors.Is(err, bucket.ErrCustomerManagedKeyAccessDenied) {

0 commit comments

Comments
 (0)