mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 03:08:01 +08:00
fix task dispatch error overload resource pool of task group (#9667)
This commit is contained in:
parent
387ebe5bb0
commit
88d2803fe1
@ -351,8 +351,6 @@ public class WorkflowExecuteThread {
|
||||
if (taskGroupQueue.getForceStart() == Flag.YES.getCode()) {
|
||||
TaskInstance taskInstance = this.processService.findTaskInstanceById(stateEvent.getTaskInstanceId());
|
||||
ITaskProcessor taskProcessor = activeTaskProcessorMaps.get(taskInstance.getTaskCode());
|
||||
ProcessInstance processInstance = this.processService.findProcessInstanceById(taskInstance.getProcessInstanceId());
|
||||
taskProcessor.init(taskInstance, processInstance);
|
||||
taskProcessor.action(TaskAction.DISPATCH);
|
||||
this.processService.updateTaskGroupQueueStatus(taskGroupQueue.getId(), TaskGroupQueueStatus.ACQUIRE_SUCCESS.getCode());
|
||||
return true;
|
||||
@ -362,8 +360,6 @@ public class WorkflowExecuteThread {
|
||||
if (acquireTaskGroup) {
|
||||
TaskInstance taskInstance = this.processService.findTaskInstanceById(stateEvent.getTaskInstanceId());
|
||||
ITaskProcessor taskProcessor = activeTaskProcessorMaps.get(taskInstance.getTaskCode());
|
||||
ProcessInstance processInstance = this.processService.findProcessInstanceById(taskInstance.getProcessInstanceId());
|
||||
taskProcessor.init(taskInstance, processInstance);
|
||||
taskProcessor.action(TaskAction.DISPATCH);
|
||||
return true;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class CommonTaskProcessor extends BaseTaskProcessor {
|
||||
taskInstance.getName(),
|
||||
taskGroupId,
|
||||
taskInstance.getProcessInstanceId(),
|
||||
taskInstance.getTaskInstancePriority().getCode());
|
||||
taskInstance.getTaskGroupPriority());
|
||||
if (!acquireTaskGroup) {
|
||||
logger.info("submit task name :{}, but the first time to try to acquire task group failed", taskInstance.getName());
|
||||
return true;
|
||||
@ -117,6 +117,11 @@ public class CommonTaskProcessor extends BaseTaskProcessor {
|
||||
taskInstance.getId(), org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP);
|
||||
|
||||
TaskExecutionContext taskExecutionContext = getTaskExecutionContext(taskInstance);
|
||||
if (taskExecutionContext == null) {
|
||||
logger.error("task get taskExecutionContext fail: {}", taskInstance);
|
||||
return false;
|
||||
}
|
||||
|
||||
taskPriority.setTaskExecutionContext(taskExecutionContext);
|
||||
|
||||
taskUpdateQueue.put(taskPriority);
|
||||
|
@ -1490,7 +1490,6 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
taskInstance.setState(ExecutionStatus.PAUSE);
|
||||
}
|
||||
taskInstance.setExecutorId(processInstance.getExecutorId());
|
||||
taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority());
|
||||
taskInstance.setState(getSubmitTaskState(taskInstance, processInstance));
|
||||
if (taskInstance.getSubmitTime() == null) {
|
||||
taskInstance.setSubmitTime(new Date());
|
||||
@ -1670,6 +1669,7 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
public void packageTaskInstance(TaskInstance taskInstance, ProcessInstance processInstance) {
|
||||
taskInstance.setProcessInstance(processInstance);
|
||||
taskInstance.setProcessDefine(processInstance.getProcessDefinition());
|
||||
taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority());
|
||||
TaskDefinition taskDefinition = this.findTaskDefinition(
|
||||
taskInstance.getTaskCode(),
|
||||
taskInstance.getTaskDefinitionVersion());
|
||||
|
Loading…
Reference in New Issue
Block a user