@@ -63,7 +63,6 @@ import (
6363 "github.com/cortexproject/cortex/pkg/util/limiter"
6464 logutil "github.com/cortexproject/cortex/pkg/util/log"
6565 util_math "github.com/cortexproject/cortex/pkg/util/math"
66- "github.com/cortexproject/cortex/pkg/util/requestmeta"
6766 "github.com/cortexproject/cortex/pkg/util/resource"
6867 "github.com/cortexproject/cortex/pkg/util/services"
6968 "github.com/cortexproject/cortex/pkg/util/spanlogger"
@@ -1697,7 +1696,7 @@ func (i *Ingester) QueryExemplars(ctx context.Context, req *client.ExemplarQuery
16971696 }
16981697
16991698 // We will report *this* request in the error too.
1700- c , err := i .trackInflightQueryRequest (ctx )
1699+ c , err := i .trackInflightQueryRequest ()
17011700 if err != nil {
17021701 return nil , err
17031702 }
@@ -1805,7 +1804,7 @@ func (i *Ingester) labelsValuesCommon(ctx context.Context, req *client.LabelValu
18051804 q .Close ()
18061805 }
18071806
1808- c , err := i .trackInflightQueryRequest (ctx )
1807+ c , err := i .trackInflightQueryRequest ()
18091808 if err != nil {
18101809 return nil , cleanup , err
18111810 }
@@ -1902,7 +1901,7 @@ func (i *Ingester) labelNamesCommon(ctx context.Context, req *client.LabelNamesR
19021901 q .Close ()
19031902 }
19041903
1905- c , err := i .trackInflightQueryRequest (ctx )
1904+ c , err := i .trackInflightQueryRequest ()
19061905 if err != nil {
19071906 return nil , cleanup , err
19081907 }
@@ -2253,7 +2252,7 @@ func (i *Ingester) QueryStream(req *client.QueryRequest, stream client.Ingester_
22532252 return nil
22542253}
22552254
2256- func (i * Ingester ) trackInflightQueryRequest (ctx context. Context ) (func (), error ) {
2255+ func (i * Ingester ) trackInflightQueryRequest () (func (), error ) {
22572256 gl := i .getInstanceLimits ()
22582257 if gl != nil && gl .MaxInflightQueryRequests > 0 {
22592258 if i .inflightQueryRequests .Load () >= gl .MaxInflightQueryRequests {
@@ -2263,7 +2262,7 @@ func (i *Ingester) trackInflightQueryRequest(ctx context.Context) (func(), error
22632262
22642263 i .maxInflightQueryRequests .Track (i .inflightQueryRequests .Inc ())
22652264
2266- if i .resourceBasedLimiter != nil && ! requestmeta . RequestFromRuler ( ctx ) {
2265+ if i .resourceBasedLimiter != nil {
22672266 if err := i .resourceBasedLimiter .AcceptNewRequest (); err != nil {
22682267 level .Warn (i .logger ).Log ("msg" , "failed to accept request" , "err" , err )
22692268 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
22832282 }
22842283 defer q .Close ()
22852284
2286- c , err := i .trackInflightQueryRequest (ctx )
2285+ c , err := i .trackInflightQueryRequest ()
22872286 if err != nil {
22882287 return 0 , 0 , 0 , 0 , err
22892288 }
0 commit comments