Browse Source

[Bug-8480][Server] fix delayed execution is useless (#9085)

Co-authored-by: caishunfeng <534328519@qq.com>
2.0.7-release
caishunfeng 3 years ago committed by GitHub
parent
commit
a4699d8f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

23
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -454,7 +454,6 @@ public class ProcessService {
/** /**
* recursive delete all task instance by process instance id * recursive delete all task instance by process instance id
* @param processInstanceId
*/ */
public void deleteWorkTaskInstanceByProcessInstanceId(int processInstanceId) { public void deleteWorkTaskInstanceByProcessInstanceId(int processInstanceId) {
List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId); List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId);
@ -1337,6 +1336,9 @@ public class ProcessService {
taskInstance.setExecutorId(processInstance.getExecutorId()); taskInstance.setExecutorId(processInstance.getExecutorId());
taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority()); taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority());
taskInstance.setState(getSubmitTaskState(taskInstance, processInstanceState)); taskInstance.setState(getSubmitTaskState(taskInstance, processInstanceState));
if (taskInstance.getSubmitTime() == null) {
taskInstance.setSubmitTime(new Date());
}
if (taskInstance.getFirstSubmitTime() == null) { if (taskInstance.getFirstSubmitTime() == null) {
taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime()); taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime());
} }
@ -1717,9 +1719,9 @@ public class ProcessService {
* @reutrn * @reutrn
*/ */
public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host, public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host,
String executePath, String executePath,
String logPath, String logPath,
int taskInstId) { int taskInstId) {
taskInstance.setState(state); taskInstance.setState(state);
taskInstance.setStartTime(startTime); taskInstance.setStartTime(startTime);
taskInstance.setHost(host); taskInstance.setHost(host);
@ -1745,14 +1747,13 @@ public class ProcessService {
* @param endTime endTime * @param endTime endTime
* @param taskInstId taskInstId * @param taskInstId taskInstId
* @param varPool varPool * @param varPool varPool
* @return
*/ */
public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state, public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state,
Date endTime, Date endTime,
int processId, int processId,
String appIds, String appIds,
int taskInstId, int taskInstId,
String varPool) { String varPool) {
taskInstance.setPid(processId); taskInstance.setPid(processId);
taskInstance.setAppLink(appIds); taskInstance.setAppLink(appIds);
taskInstance.setState(state); taskInstance.setState(state);
@ -2464,7 +2465,7 @@ public class ProcessService {
taskCodeVersionMap.put(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion()); taskCodeVersionMap.put(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion());
} }
} }
taskCodeVersionMap.forEach((code,version) -> { taskCodeVersionMap.forEach((code, version) -> {
taskDefinitionLogs.add((TaskDefinitionLog) this.findTaskDefinition(code, version)); taskDefinitionLogs.add((TaskDefinitionLog) this.findTaskDefinition(code, version));
}); });
return taskDefinitionLogs; return taskDefinitionLogs;

Loading…
Cancel
Save