Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RateLimiter creation has been fixed for analytical queries (ydb-platf…
Browse files Browse the repository at this point in the history
dorooleg authored Oct 29, 2024
1 parent ba86523 commit e08e74c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ydb/core/fq/libs/control_plane_proxy/actors/request_actor.h
Original file line number Diff line number Diff line change
@@ -202,9 +202,15 @@ class TCreateQueryRequestActor :
}
}

bool ShouldCreateRateLimiter() const {
return RequestProxy->Get()->Quotas
&& (RequestProxy->Get()->Request.content().type() == FederatedQuery::QueryContent::STREAMING
|| !Config.ComputeConfig.YdbComputeControlPlaneEnabled(RequestProxy->Get()->Scope));
}

void OnBootstrap() override {
this->UnsafeBecome(&TCreateQueryRequestActor::StateFunc);
if (RequestProxy->Get()->Quotas) {
if (ShouldCreateRateLimiter()) {
SendCreateRateLimiterResourceRequest();
} else {
SendRequestIfCan();
@@ -249,7 +255,7 @@ class TCreateQueryRequestActor :
}

bool CanSendRequest() const override {
return (QuoterResourceCreated || !RequestProxy->Get()->Quotas) && TBaseRequestActor::CanSendRequest();
return (QuoterResourceCreated || !ShouldCreateRateLimiter()) && TBaseRequestActor::CanSendRequest();
}
};

0 comments on commit e08e74c

Please sign in to comment.