Browse Source

Fix worker overload will casue task failed (#16221)

dev
Wenjun Ruan 4 months ago committed by GitHub
parent
commit
02bef74296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java

9
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java

@ -55,10 +55,11 @@ public abstract class BaseTaskDispatcher implements TaskDispatcher {
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);

Loading…
Cancel
Save