Skip to content

Commit e392541

Browse files
authored
Don't queue requests for workers if their capacity is empty. (#7979)
1 parent 44ca93c commit e392541

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ydb/library/yql/providers/dq/global_worker_manager/global_worker_manager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,11 @@ class TGlobalWorkerManager: public TWorkerManagerCommon<TGlobalWorkerManager> {
809809
const auto count = ev->Get()->Record.GetCount();
810810
Y_ASSERT(count != 0);
811811

812+
if (!Workers.Capacity()) {
813+
Send(ev->Sender, new TEvAllocateWorkersResponse("Empty workers capacity", NYql::NDqProto::StatusIds::OVERLOADED));
814+
return;
815+
}
816+
812817
if (!Scheduler->Suspend(NDq::IScheduler::TWaitInfo(ev->Get()->Record, ev->Sender))) {
813818
Send(ev->Sender, new TEvAllocateWorkersResponse("Too many dq operations", NYql::NDqProto::StatusIds::OVERLOADED));
814819
return;

0 commit comments

Comments
 (0)