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:
Egon Elbre 2021-09-21 12:45:21 +03:00
parent 69d3a839fc
commit 32cee1e572

View File

@ -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
}