From c587b538ed816bc8ac16c8ef33432dd9a5edc90f Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 5 Apr 2023 17:01:03 -0600 Subject: [PATCH] Fail through to next middleware when querySizeLimit cannot be applied (#9050) **What this PR does / why we need it**: When the query size limiter can't limit the query, fail through to the next middleware instead of erroring. This can happen, for example, when a query spans schemas, which is still a valid query case, so we want to make sure to fall back to existing behavior. --------- Co-authored-by: Owen Diehl --- pkg/querier/queryrange/limits.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/querier/queryrange/limits.go b/pkg/querier/queryrange/limits.go index ba544126a7841..07821030db370 100644 --- a/pkg/querier/queryrange/limits.go +++ b/pkg/querier/queryrange/limits.go @@ -353,7 +353,8 @@ func (q *querySizeLimiter) Do(ctx context.Context, r queryrangebase.Request) (qu // Only support TSDB schemaCfg, err := q.getSchemaCfg(r) if err != nil { - return nil, httpgrpc.Errorf(http.StatusInternalServerError, "Failed to get schema config: %s", err.Error()) + level.Error(log).Log("msg", "failed to get schema config, not applying querySizeLimit", "err", err) + return q.next.Do(ctx, r) } if schemaCfg.IndexType != config.TSDBType { return q.next.Do(ctx, r)