Skip to content

Commit 9935637

Browse files
authored
Don't wait in scheduler queue if all workers out. (#8002)
1 parent fc74b88 commit 9935637

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,15 @@ class TGlobalWorkerManager: public TWorkerManagerCommon<TGlobalWorkerManager> {
781781
}
782782

783783
void TryResume() {
784-
if (Workers.FreeSlots() >= ScheduleWaitCount) {
784+
if (!Workers.Capacity() && ScheduleWaitCount > 0U) {
785+
Scheduler->ProcessAll([&] (const auto& item) {
786+
Send(item.Sender, new TEvAllocateWorkersResponse("All workers shutted down", NYql::NDqProto::StatusIds::OVERLOADED));
787+
return true;
788+
});
789+
790+
ScheduleWaitCount = 0U;
791+
DeadOperations.clear();
792+
} else if (Workers.FreeSlots() >= ScheduleWaitCount) {
785793
Scheduler->Process(Workers.Capacity(), Workers.FreeSlots(), [&] (const auto& item) {
786794
auto maybeDead = DeadOperations.find(item.Request.GetResourceId());
787795
if (maybeDead != DeadOperations.end()) {

0 commit comments

Comments
 (0)