Skip to content

Commit

Permalink
Fix worker overload will casue task failed (#16221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun authored Jun 27, 2024
1 parent e856681 commit 02bef74
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ public void dispatchTask(TaskExecuteRunnable taskExecuteRunnable) throws TaskDis
taskInstanceDispatchHost = getTaskInstanceDispatchHost(taskExecuteRunnable)
.orElseThrow(() -> new TaskDispatchException("Cannot find the host to execute task."));
} catch (WorkerGroupNotFoundException workerGroupNotFoundException) {
log.error("Dispatch task: {} failed, worker group not found.",
taskExecuteRunnable.getTaskExecutionContext().getTaskName(), workerGroupNotFoundException);
addDispatchFailedEvent(taskExecuteRunnable);
return;
// todo: this is a temporary solution, we should refactor the ServerNodeManager to make sure there won't
// throw WorkerGroupNotFoundException unless the worker group is not exist in database
throw new TaskDispatchException(
"Dispatch task: " + taskExecuteRunnable.getTaskExecutionContext().getTaskName() + " failed",
workerGroupNotFoundException);
}
taskExecuteRunnable.getTaskExecutionContext().setHost(taskInstanceDispatchHost.getAddress());
doDispatch(taskExecuteRunnable);
Expand Down

0 comments on commit 02bef74

Please sign in to comment.