satellite/metabase/segmentloop: ensure we shutdown on ctx err
Not all errors from RunOnce can be retried. The context can be cancelled with several different errors, e.g. timeout. Ensure we stop the loop when context has errored, because none of the queries will succeed when it has failed. Change-Id: If3ff11f11a6f43c0d67633be1cfaf23e3e9e55f3
This commit is contained in:
parent
69d3a839fc
commit
32cee1e572
@ -232,6 +232,9 @@ func (loop *Service) Run(ctx context.Context) (err error) {
|
||||
if errs2.IsCanceled(err) {
|
||||
return err
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
return errs.Combine(err, ctx.Err())
|
||||
}
|
||||
|
||||
mon.Event("segmentloop_error") //mon:locked
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user