|
|
@ -55,10 +55,11 @@ public abstract class BaseTaskDispatcher implements TaskDispatcher { |
|
|
|
taskInstanceDispatchHost = getTaskInstanceDispatchHost(taskExecuteRunnable) |
|
|
|
taskInstanceDispatchHost = getTaskInstanceDispatchHost(taskExecuteRunnable) |
|
|
|
.orElseThrow(() -> new TaskDispatchException("Cannot find the host to execute task.")); |
|
|
|
.orElseThrow(() -> new TaskDispatchException("Cannot find the host to execute task.")); |
|
|
|
} catch (WorkerGroupNotFoundException workerGroupNotFoundException) { |
|
|
|
} catch (WorkerGroupNotFoundException workerGroupNotFoundException) { |
|
|
|
log.error("Dispatch task: {} failed, worker group not found.", |
|
|
|
// todo: this is a temporary solution, we should refactor the ServerNodeManager to make sure there won't
|
|
|
|
taskExecuteRunnable.getTaskExecutionContext().getTaskName(), workerGroupNotFoundException); |
|
|
|
// throw WorkerGroupNotFoundException unless the worker group is not exist in database
|
|
|
|
addDispatchFailedEvent(taskExecuteRunnable); |
|
|
|
throw new TaskDispatchException( |
|
|
|
return; |
|
|
|
"Dispatch task: " + taskExecuteRunnable.getTaskExecutionContext().getTaskName() + " failed", |
|
|
|
|
|
|
|
workerGroupNotFoundException); |
|
|
|
} |
|
|
|
} |
|
|
|
taskExecuteRunnable.getTaskExecutionContext().setHost(taskInstanceDispatchHost.getAddress()); |
|
|
|
taskExecuteRunnable.getTaskExecutionContext().setHost(taskInstanceDispatchHost.getAddress()); |
|
|
|
doDispatch(taskExecuteRunnable); |
|
|
|
doDispatch(taskExecuteRunnable); |
|
|
|