@@ -63,7 +63,6 @@ import (
63
63
"github.com/cortexproject/cortex/pkg/util/limiter"
64
64
logutil "github.com/cortexproject/cortex/pkg/util/log"
65
65
util_math "github.com/cortexproject/cortex/pkg/util/math"
66
- "github.com/cortexproject/cortex/pkg/util/requestmeta"
67
66
"github.com/cortexproject/cortex/pkg/util/resource"
68
67
"github.com/cortexproject/cortex/pkg/util/services"
69
68
"github.com/cortexproject/cortex/pkg/util/spanlogger"
@@ -1697,7 +1696,7 @@ func (i *Ingester) QueryExemplars(ctx context.Context, req *client.ExemplarQuery
1697
1696
}
1698
1697
1699
1698
// We will report *this* request in the error too.
1700
- c , err := i .trackInflightQueryRequest (ctx )
1699
+ c , err := i .trackInflightQueryRequest ()
1701
1700
if err != nil {
1702
1701
return nil , err
1703
1702
}
@@ -1805,7 +1804,7 @@ func (i *Ingester) labelsValuesCommon(ctx context.Context, req *client.LabelValu
1805
1804
q .Close ()
1806
1805
}
1807
1806
1808
- c , err := i .trackInflightQueryRequest (ctx )
1807
+ c , err := i .trackInflightQueryRequest ()
1809
1808
if err != nil {
1810
1809
return nil , cleanup , err
1811
1810
}
@@ -1902,7 +1901,7 @@ func (i *Ingester) labelNamesCommon(ctx context.Context, req *client.LabelNamesR
1902
1901
q .Close ()
1903
1902
}
1904
1903
1905
- c , err := i .trackInflightQueryRequest (ctx )
1904
+ c , err := i .trackInflightQueryRequest ()
1906
1905
if err != nil {
1907
1906
return nil , cleanup , err
1908
1907
}
@@ -2253,7 +2252,7 @@ func (i *Ingester) QueryStream(req *client.QueryRequest, stream client.Ingester_
2253
2252
return nil
2254
2253
}
2255
2254
2256
- func (i * Ingester ) trackInflightQueryRequest (ctx context. Context ) (func (), error ) {
2255
+ func (i * Ingester ) trackInflightQueryRequest () (func (), error ) {
2257
2256
gl := i .getInstanceLimits ()
2258
2257
if gl != nil && gl .MaxInflightQueryRequests > 0 {
2259
2258
if i .inflightQueryRequests .Load () >= gl .MaxInflightQueryRequests {
@@ -2263,7 +2262,7 @@ func (i *Ingester) trackInflightQueryRequest(ctx context.Context) (func(), error
2263
2262
2264
2263
i .maxInflightQueryRequests .Track (i .inflightQueryRequests .Inc ())
2265
2264
2266
- if i .resourceBasedLimiter != nil && ! requestmeta . RequestFromRuler ( ctx ) {
2265
+ if i .resourceBasedLimiter != nil {
2267
2266
if err := i .resourceBasedLimiter .AcceptNewRequest (); err != nil {
2268
2267
level .Warn (i .logger ).Log ("msg" , "failed to accept request" , "err" , err )
2269
2268
return nil , httpgrpc .Errorf (http .StatusServiceUnavailable , "failed to query: %s" , limiter .ErrResourceLimitReachedStr )
@@ -2283,7 +2282,7 @@ func (i *Ingester) queryStreamChunks(ctx context.Context, db *userTSDB, from, th
2283
2282
}
2284
2283
defer q .Close ()
2285
2284
2286
- c , err := i .trackInflightQueryRequest (ctx )
2285
+ c , err := i .trackInflightQueryRequest ()
2287
2286
if err != nil {
2288
2287
return 0 , 0 , 0 , 0 , err
2289
2288
}
0 commit comments