status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (childInstance == null) { String fatherHistoryCommand = parentProcessInstance.getHistoryCmd(); commandType = CommandType.valueOf(fatherHistoryCommand.split(Constants.COMMA)[0]); } return commandType; } /** * update sub process definition * * @param parentProcessInstance parentProcessInstance * @param childDefinitionCode childDefinitionId */ private void updateSubProcessDefinitionByParent(ProcessInstance parentProcessInstance, long childDefinitionCode) { ProcessDefinition fatherDefinition = this.findProcessDefinition(parentProcessInstance.getProcessDefinitionCode(), parentProcessInstance.getProcessDefinitionVersion()); ProcessDefinition childDefinition = this.findProcessDefinitionByCode(childDefinitionCode); if (childDefinition != null && fatherDefinition != null) { childDefinition.setWarningGroupId(fatherDefinition.getWarningGroupId()); processDefineMapper.updateById(childDefinition); } } /** * submit task to mysql * * @param taskInstance taskInstance * @param processInstance processInstance * @return task instance */ public TaskInstance submitTaskInstanceToDB(TaskInstance taskInstance, ProcessInstance processInstance) { ExecutionStatus processInstanceState = processInstance.getState();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (taskInstance.getState().typeIsFailure()) { if (taskInstance.isSubProcess()) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } else { if (processInstanceState != ExecutionStatus.READY_STOP && processInstanceState != ExecutionStatus.READY_PAUSE) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); if (taskInstance.getState() != ExecutionStatus.NEED_FAULT_TOLERANCE) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } taskInstance.setSubmitTime(null); taskInstance.setStartTime(null); taskInstance.setEndTime(null); taskInstance.setFlag(Flag.YES); taskInstance.setHost(null); taskInstance.setId(0); } } } taskInstance.setExecutorId(processInstance.getExecutorId()); taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority()); taskInstance.setState(getSubmitTaskState(taskInstance, processInstanceState)); if (taskInstance.getSubmitTime() == null) { taskInstance.setSubmitTime(new Date()); } if (taskInstance.getFirstSubmitTime() == null) { taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} boolean saveResult = saveTaskInstance(taskInstance); if (!saveResult) { return null; } return taskInstance; } /** * get submit task instance state by the work process state * cannot modify the task state when running/kill/submit success, or this * task instance is already exists in task queue . * return pause if work process state is ready pause * return stop if work process state is ready stop * if all of above are not satisfied, return submit success * * @param taskInstance taskInstance * @param processInstanceState processInstanceState * @return process instance state */ public ExecutionStatus getSubmitTaskState(TaskInstance taskInstance, ExecutionStatus processInstanceState) { ExecutionStatus state = taskInstance.getState(); if ( state == ExecutionStatus.RUNNING_EXECUTION || state == ExecutionStatus.DELAY_EXECUTION || state == ExecutionStatus.KILL ) { return state;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} if (processInstanceState == ExecutionStatus.READY_PAUSE) { state = ExecutionStatus.PAUSE; } else if (processInstanceState == ExecutionStatus.READY_STOP || !checkProcessStrategy(taskInstance)) { state = ExecutionStatus.KILL; } else { state = ExecutionStatus.SUBMITTED_SUCCESS; } return state; } /** * check process instance strategy * * @param taskInstance taskInstance * @return check strategy result */ private boolean checkProcessStrategy(TaskInstance taskInstance) { ProcessInstance processInstance = this.findProcessInstanceById(taskInstance.getProcessInstanceId()); FailureStrategy failureStrategy = processInstance.getFailureStrategy(); if (failureStrategy == FailureStrategy.CONTINUE) { return true; } List<TaskInstance> taskInstances = this.findValidTaskListByProcessId(taskInstance.getProcessInstanceId()); for (TaskInstance task : taskInstances) { if (task.getState() == ExecutionStatus.FAILURE && task.getRetryTimes() >= task.getMaxRetryTimes()) { return false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } return true; } /** * insert or update work process instance to data base * * @param processInstance processInstance */ public void saveProcessInstance(ProcessInstance processInstance) { if (processInstance == null) { logger.error("save error, process instance is null!"); return; } if (processInstance.getId() != 0) { processInstanceMapper.updateById(processInstance); } else { processInstanceMapper.insert(processInstance); } } /** * insert or update command * * @param command command * @return save command result */ public int saveCommand(Command command) { if (command.getId() != 0) { return commandMapper.updateById(command); } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return commandMapper.insert(command); } } /** * insert or update task instance * * @param taskInstance taskInstance * @return save task instance result */ public boolean saveTaskInstance(TaskInstance taskInstance) { if (taskInstance.getId() != 0) { return updateTaskInstance(taskInstance); } else { return createTaskInstance(taskInstance); } } /** * insert task instance * * @param taskInstance taskInstance * @return create task instance result */ public boolean createTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.insert(taskInstance); return count > 0; } /** * update task instance * * @param taskInstance taskInstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return update task instance result */ public boolean updateTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.updateById(taskInstance); return count > 0; } /** * find task instance by id * * @param taskId task id * @return task intance */ public TaskInstance findTaskInstanceById(Integer taskId) { return taskInstanceMapper.selectById(taskId); } /** * package task instance,associate processInstance and processDefine * * @param taskInstId taskInstId * @return task instance */ public TaskInstance getTaskInstanceDetailByTaskId(int taskInstId) { // TaskInstance taskInstance = findTaskInstanceById(taskInstId); if (taskInstance == null) { return null; } // ProcessInstance processInstance = findProcessInstanceDetailById(taskInstance.getProcessInstanceId()); //
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessDefinition processDefine = findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); taskInstance.setProcessInstance(processInstance); taskInstance.setProcessDefine(processDefine); TaskDefinition taskDefinition = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion( taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion()); taskInstance.setTaskDefine(taskDefinition); return taskInstance; } /** * get id list by task state * * @param instanceId instanceId * @param state state * @return task instance states */ public List<Integer> findTaskIdByInstanceState(int instanceId, ExecutionStatus state) { return taskInstanceMapper.queryTaskByProcessIdAndState(instanceId, state.ordinal()); } /** * find valid task list by process definition id * * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findValidTaskListByProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.YES); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* find previous task list by work process id * * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findPreviousTaskListByWorkProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.NO); } /** * update work process instance map * * @param processInstanceMap processInstanceMap * @return update process instance result */ public int updateWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { return processInstanceMapMapper.updateById(processInstanceMap); } /** * create work process instance map * * @param processInstanceMap processInstanceMap * @return create process instance result */ public int createWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { int count = 0; if (processInstanceMap != null) { return processInstanceMapMapper.insert(processInstanceMap); } return count; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/** * find work process map by parent process id and parent task id. * * @param parentWorkProcessId parentWorkProcessId * @param parentTaskId parentTaskId * @return process instance map */ public ProcessInstanceMap findWorkProcessMapByParent(Integer parentWorkProcessId, Integer parentTaskId) { return processInstanceMapMapper.queryByParentId(parentWorkProcessId, parentTaskId); } /** * delete work process map by parent process id * * @param parentWorkProcessId parentWorkProcessId * @return delete process map result */ public int deleteWorkProcessMapByParentId(int parentWorkProcessId) { return processInstanceMapMapper.deleteByParentProcessId(parentWorkProcessId); } /** * find sub process instance * * @param parentProcessId parentProcessId * @param parentTaskId parentTaskId * @return process instance */ public ProcessInstance findSubProcessInstance(Integer parentProcessId, Integer parentTaskId) { ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryByParentId(parentProcessId, parentTaskId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return processInstance; } processInstance = findProcessInstanceById(processInstanceMap.getProcessInstanceId()); return processInstance; } /** * find parent process instance * * @param subProcessId subProcessId * @return process instance */ public ProcessInstance findParentProcessInstance(Integer subProcessId) { ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryBySubProcessId(subProcessId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) { return processInstance; } processInstance = findProcessInstanceById(processInstanceMap.getParentProcessInstanceId()); return processInstance; } /** * change task state * * @param state state * @param startTime startTime * @param host host * @param executePath executePath * @param logPath logPath * @param taskInstId taskInstId */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host, String executePath, String logPath, int taskInstId) { taskInstance.setState(state); taskInstance.setStartTime(startTime); taskInstance.setHost(host); taskInstance.setExecutePath(executePath); taskInstance.setLogPath(logPath); saveTaskInstance(taskInstance); } /** * update process instance * * @param processInstance processInstance * @return update process instance result */ public int updateProcessInstance(ProcessInstance processInstance) { return processInstanceMapper.updateById(processInstance); } /** * change task state * * @param state state * @param endTime endTime * @param taskInstId taskInstId * @param varPool varPool */ public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date endTime,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
int processId, String appIds, int taskInstId, String varPool) { taskInstance.setPid(processId); taskInstance.setAppLink(appIds); taskInstance.setState(state); taskInstance.setEndTime(endTime); taskInstance.setVarPool(varPool); changeOutParam(taskInstance); saveTaskInstance(taskInstance); } /** * for show in page of taskInstance * * @param taskInstance */ public void changeOutParam(TaskInstance taskInstance) { if (StringUtils.isEmpty(taskInstance.getVarPool())) { return; } List<Property> properties = JSONUtils.toList(taskInstance.getVarPool(), Property.class); if (CollectionUtils.isEmpty(properties)) { return; } // Map<String, Object> taskParams = JSONUtils.toMap(taskInstance.getTaskParams(), String.class, Object.class); Object localParams = taskParams.get(LOCAL_PARAMS); if (localParams == null) { return;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} List<Property> allParam = JSONUtils.toList(JSONUtils.toJsonString(localParams), Property.class); Map<String, String> outProperty = new HashMap<>(); for (Property info : properties) { if (info.getDirect() == Direct.OUT) { outProperty.put(info.getProp(), info.getValue()); } } for (Property info : allParam) { if (info.getDirect() == Direct.OUT) { String paramName = info.getProp(); info.setValue(outProperty.get(paramName)); } } taskParams.put(LOCAL_PARAMS, allParam); taskInstance.setTaskParams(JSONUtils.toJsonString(taskParams)); } /** * convert integer list to string list * * @param intList intList * @return string list */ public List<String> convertIntListToString(List<Integer> intList) { if (intList == null) { return new ArrayList<>(); } List<String> result = new ArrayList<>(intList.size()); for (Integer intVar : intList) { result.add(String.valueOf(intVar));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} return result; } /** * query schedule by id * * @param id id * @return schedule */ public Schedule querySchedule(int id) { return scheduleMapper.selectById(id); } /** * query Schedule by processDefinitionCode * * @param processDefinitionCode processDefinitionCode * @see Schedule */ public List<Schedule> queryReleaseSchedulerListByProcessDefinitionCode(long processDefinitionCode) { return scheduleMapper.queryReleaseSchedulerListByProcessDefinitionCode(processDefinitionCode); } /** * query need failover process instance * * @param host host * @return process instance list */ public List<ProcessInstance> queryNeedFailoverProcessInstances(String host) { return processInstanceMapper.queryByHostAndStatus(host, stateArray); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/** * process need failover process instance * * @param processInstance processInstance */ @Transactional(rollbackFor = RuntimeException.class) public void processNeedFailoverProcessInstances(ProcessInstance processInstance) { // processInstance.setHost(Constants.NULL); processInstanceMapper.updateById(processInstance); ProcessDefinition processDefinition = findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); // Command cmd = new Command(); cmd.setProcessDefinitionCode(processDefinition.getCode()); cmd.setCommandParam(String.format("{\"%s\":%d}", Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING, processInstance.getId())); cmd.setExecutorId(processInstance.getExecutorId()); cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS); createCommand(cmd); } /** * query all need failover task instances by host * * @param host host * @return task instance list */ public List<TaskInstance> queryNeedFailoverTaskInstances(String host) { return taskInstanceMapper.queryByHostAndStatus(host, stateArray); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* find data source by id * * @param id id * @return datasource */ public DataSource findDataSourceById(int id) { return dataSourceMapper.selectById(id); } /** * update process instance state by id * * @param processInstanceId processInstanceId * @param executionStatus executionStatus * @return update process result */ public int updateProcessInstanceState(Integer processInstanceId, ExecutionStatus executionStatus) { ProcessInstance instance = processInstanceMapper.selectById(processInstanceId); instance.setState(executionStatus); return processInstanceMapper.updateById(instance); } /** * find process instance by the task id * * @param taskId taskId * @return process instance */ public ProcessInstance findProcessInstanceByTaskId(int taskId) { TaskInstance taskInstance = taskInstanceMapper.selectById(taskId); if (taskInstance != null) { return processInstanceMapper.selectById(taskInstance.getProcessInstanceId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} return null; } /** * find udf function list by id list string * * @param ids ids * @return udf function list */ public List<UdfFunc> queryUdfFunListByIds(int[] ids) { return udfFuncMapper.queryUdfByIdStr(ids, null); } /** * find tenant code by resource name * * @param resName resource name * @param resourceType resource type * @return tenant code */ public String queryTenantCodeByResName(String resName, ResourceType resourceType) { // String fullName = resName.startsWith("/") ? resName : String.format("/%s", resName); List<Resource> resourceList = resourceMapper.queryResource(fullName, resourceType.ordinal()); if (CollectionUtils.isEmpty(resourceList)) { return StringUtils.EMPTY; } int userId = resourceList.get(0).getUserId(); User user = userMapper.selectById(userId); if (Objects.isNull(user)) { return StringUtils.EMPTY;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} Tenant tenant = tenantMapper.selectById(user.getTenantId()); if (Objects.isNull(tenant)) { return StringUtils.EMPTY; } return tenant.getTenantCode(); } /** * find schedule list by process define codes. * * @param codes codes * @return schedule list */ public List<Schedule> selectAllByProcessDefineCode(long[] codes) { return scheduleMapper.selectAllByProcessDefineArray(codes); } /** * find last scheduler process instance in the date interval * * @param definitionCode definitionCode * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastSchedulerProcessInterval(Long definitionCode, DateInterval dateInterval) { return processInstanceMapper.queryLastSchedulerProcess(definitionCode, dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last manual process instance interval
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param definitionCode process definition code * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastManualProcessInterval(Long definitionCode, DateInterval dateInterval) { return processInstanceMapper.queryLastManualProcess(definitionCode, dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last running process instance * * @param definitionCode process definition code * @param startTime start time * @param endTime end time * @return process instance */ public ProcessInstance findLastRunningProcess(Long definitionCode, Date startTime, Date endTime) { return processInstanceMapper.queryLastRunningProcess(definitionCode, startTime, endTime, stateArray); } /** * query user queue by process instance id * * @param processInstanceId processInstanceId * @return queue */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public String queryUserQueueByProcessInstanceId(int processInstanceId) { String queue = ""; ProcessInstance processInstance = processInstanceMapper.selectById(processInstanceId); if (processInstance == null) { return queue; } User executor = userMapper.selectById(processInstance.getExecutorId()); if (executor != null) { queue = executor.getQueue(); } return queue; } /** * query project name and user name by processInstanceId. * * @param processInstanceId processInstanceId * @return projectName and userName */ public ProjectUser queryProjectWithUserByProcessInstanceId(int processInstanceId) { return projectMapper.queryProjectWithUserByProcessInstanceId(processInstanceId); } /** * get task worker group * * @param taskInstance taskInstance * @return workerGroupId */ public String getTaskWorkerGroup(TaskInstance taskInstance) { String workerGroup = taskInstance.getWorkerGroup(); if (StringUtils.isNotBlank(workerGroup)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return workerGroup; } int processInstanceId = taskInstance.getProcessInstanceId(); ProcessInstance processInstance = findProcessInstanceById(processInstanceId); if (processInstance != null) { return processInstance.getWorkerGroup(); } logger.info("task : {} will use default worker group", taskInstance.getId()); return Constants.DEFAULT_WORKER_GROUP; } /** * get have perm project list * * @param userId userId * @return project list */ public List<Project> getProjectListHavePerm(int userId) { List<Project> createProjects = projectMapper.queryProjectCreatedByUser(userId); List<Project> authedProjects = projectMapper.queryAuthedProjectListByUserId(userId); if (createProjects == null) { createProjects = new ArrayList<>(); } if (authedProjects != null) { createProjects.addAll(authedProjects); } return createProjects; } /** * list unauthorized udf function *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param userId user id * @param needChecks data source id array * @return unauthorized udf function list */ public <T> List<T> listUnauthorized(int userId, T[] needChecks, AuthorizationType authorizationType) { List<T> resultList = new ArrayList<>(); if (Objects.nonNull(needChecks) && needChecks.length > 0) { Set<T> originResSet = new HashSet<>(Arrays.asList(needChecks)); switch (authorizationType) { case RESOURCE_FILE_ID: case UDF_FILE: List<Resource> ownUdfResources = resourceMapper.listAuthorizedResourceById(userId, needChecks); addAuthorizedResources(ownUdfResources, userId); Set<Integer> authorizedResourceFiles = ownUdfResources.stream().map(Resource::getId).collect(toSet()); originResSet.removeAll(authorizedResourceFiles); break; case RESOURCE_FILE_NAME: List<Resource> ownResources = resourceMapper.listAuthorizedResource(userId, needChecks); addAuthorizedResources(ownResources, userId); Set<String> authorizedResources = ownResources.stream().map(Resource::getFullName).collect(toSet()); originResSet.removeAll(authorizedResources); break; case DATASOURCE: Set<Integer> authorizedDatasources = dataSourceMapper.listAuthorizedDataSource(userId, needChecks).stream().map(DataSource::getId).collect(toSet()); originResSet.removeAll(authorizedDatasources); break; case UDF: Set<Integer> authorizedUdfs = udfFuncMapper.listAuthorizedUdfFunc(userId, needChecks).stream().map(UdfFunc::getId).collect(toSet()); originResSet.removeAll(authorizedUdfs); break;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
default: break; } resultList.addAll(originResSet); } return resultList; } /** * get user by user id * * @param userId user id * @return User */ public User getUserById(int userId) { return userMapper.selectById(userId); } /** * get resource by resource id * * @param resourceId resource id * @return Resource */ public Resource getResourceById(int resourceId) { return resourceMapper.selectById(resourceId); } /** * list resources by ids * * @param resIds resIds * @return resource list
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ public List<Resource> listResourceByIds(Integer[] resIds) { return resourceMapper.listResourceByIds(resIds); } /** * format task app id in task instance */ public String formatTaskAppId(TaskInstance taskInstance) { ProcessInstance processInstance = findProcessInstanceById(taskInstance.getProcessInstanceId()); if (processInstance == null) { return ""; } ProcessDefinition definition = findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); if (definition == null) { return ""; } return String.format("%s_%s_%s", definition.getId(), processInstance.getId(), taskInstance.getId()); } /** * switch process definition version to process definition log version */ public int switchVersion(ProcessDefinition processDefinition, ProcessDefinitionLog processDefinitionLog) { if (null == processDefinition || null == processDefinitionLog) { return Constants.DEFINITION_FAILURE; } processDefinitionLog.setId(processDefinition.getId()); processDefinitionLog.setReleaseState(ReleaseState.OFFLINE); processDefinitionLog.setFlag(Flag.YES); int result = processDefineMapper.updateById(processDefinitionLog); if (result > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
result = switchProcessTaskRelationVersion(processDefinition); if (result <= 0) { return Constants.DEFINITION_FAILURE; } } return result; } public int switchProcessTaskRelationVersion(ProcessDefinition processDefinition) { List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(processDefinition.getProjectCode(), processDefinition.getCode()); if (!processTaskRelationList.isEmpty()) { processTaskRelationMapper.deleteByCode(processDefinition.getProjectCode(), processDefinition.getCode()); } List<ProcessTaskRelationLog> processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion()); return processTaskRelationMapper.batchInsert(processTaskRelationLogList); } /** * get resource ids * * @param taskDefinition taskDefinition * @return resource ids */ public String getResourceIds(TaskDefinition taskDefinition) { Set<Integer> resourceIds = null; AbstractParameters params = TaskParametersUtils.getParameters(taskDefinition.getTaskType(), taskDefinition.getTaskParams()); if (params != null && CollectionUtils.isNotEmpty(params.getResourceFilesList())) { resourceIds = params.getResourceFilesList(). stream() .filter(t -> t.getId() != 0) .map(ResourceInfo::getId) .collect(Collectors.toSet());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} if (CollectionUtils.isEmpty(resourceIds)) { return StringUtils.EMPTY; } return StringUtils.join(resourceIds, ","); } public boolean saveTaskDefine(User operator, long projectCode, List<TaskDefinitionLog> taskDefinitionLogs) { Date now = new Date(); List<TaskDefinitionLog> newTaskDefinitionLogs = new ArrayList<>(); List<TaskDefinitionLog> updateTaskDefinitionLogs = new ArrayList<>(); for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) { taskDefinitionLog.setProjectCode(projectCode); taskDefinitionLog.setUpdateTime(now); taskDefinitionLog.setOperateTime(now); taskDefinitionLog.setOperator(operator.getId()); taskDefinitionLog.setResourceIds(getResourceIds(taskDefinitionLog)); if (taskDefinitionLog.getCode() > 0 && taskDefinitionLog.getVersion() > 0) { TaskDefinitionLog definitionCodeAndVersion = taskDefinitionLogMapper .queryByDefinitionCodeAndVersion(taskDefinitionLog.getCode(), taskDefinitionLog.getVersion()); if (definitionCodeAndVersion != null) { if (!taskDefinitionLog.equals(definitionCodeAndVersion)) { taskDefinitionLog.setUserId(definitionCodeAndVersion.getUserId()); Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskDefinitionLog.getCode()); taskDefinitionLog.setVersion(version + 1); taskDefinitionLog.setCreateTime(definitionCodeAndVersion.getCreateTime()); updateTaskDefinitionLogs.add(taskDefinitionLog); } continue; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskDefinitionLog.setUserId(operator.getId()); taskDefinitionLog.setVersion(Constants.VERSION_FIRST); taskDefinitionLog.setCreateTime(now); if (taskDefinitionLog.getCode() == 0) { try { taskDefinitionLog.setCode(SnowFlakeUtils.getInstance().nextId()); } catch (SnowFlakeException e) { logger.error("Task code get error, ", e); return false; } } newTaskDefinitionLogs.add(taskDefinitionLog); } for (TaskDefinitionLog taskDefinitionToUpdate : updateTaskDefinitionLogs) { TaskDefinition task = taskDefinitionMapper.queryByCode(taskDefinitionToUpdate.getCode()); if (task == null) { newTaskDefinitionLogs.add(taskDefinitionToUpdate); } else { int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate); taskDefinitionToUpdate.setId(task.getId()); int update = taskDefinitionMapper.updateById(taskDefinitionToUpdate); if ((update & insert) != 1) { return false; } } } if (!newTaskDefinitionLogs.isEmpty()) { int insert = taskDefinitionMapper.batchInsert(newTaskDefinitionLogs); int logInsert = taskDefinitionLogMapper.batchInsert(newTaskDefinitionLogs); return (logInsert & insert) != 0;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} return true; } /** * save processDefinition (including create or update processDefinition) */ public int saveProcessDefine(User operator, ProcessDefinition processDefinition, Boolean isFromProcessDefine) { ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog(processDefinition); Integer version = processDefineLogMapper.queryMaxVersionForDefinition(processDefinition.getCode()); int insertVersion = version == null || version == 0 ? Constants.VERSION_FIRST : version + 1; processDefinitionLog.setVersion(insertVersion); processDefinitionLog.setReleaseState(isFromProcessDefine ? ReleaseState.OFFLINE : ReleaseState.ONLINE); processDefinitionLog.setOperator(operator.getId()); processDefinitionLog.setOperateTime(processDefinition.getUpdateTime()); int insertLog = processDefineLogMapper.insert(processDefinitionLog); int result; if (0 == processDefinition.getId()) { result = processDefineMapper.insert(processDefinitionLog); } else { processDefinitionLog.setId(processDefinition.getId()); result = processDefineMapper.updateById(processDefinitionLog); } return (insertLog & result) > 0 ? insertVersion : 0; } /** * save task relations */ public int saveTaskRelation(User operator, long projectCode, long processDefinitionCode, int processDefinitionVersion, List<ProcessTaskRelationLog> taskRelationList, List<TaskDefinitionLog> taskDefinitionLogs) { Map<Long, TaskDefinitionLog> taskDefinitionLogMap = null;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (CollectionUtils.isNotEmpty(taskDefinitionLogs)) { taskDefinitionLogMap = taskDefinitionLogs.stream() .collect(Collectors.toMap(TaskDefinition::getCode, taskDefinitionLog -> taskDefinitionLog)); } Date now = new Date(); for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { processTaskRelationLog.setProjectCode(projectCode); processTaskRelationLog.setProcessDefinitionCode(processDefinitionCode); processTaskRelationLog.setProcessDefinitionVersion(processDefinitionVersion); if (taskDefinitionLogMap != null) { TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMap.get(processTaskRelationLog.getPreTaskCode()); if (taskDefinitionLog != null) { processTaskRelationLog.setPreTaskVersion(taskDefinitionLog.getVersion()); } processTaskRelationLog.setPostTaskVersion(taskDefinitionLogMap.get(processTaskRelationLog.getPostTaskCode()).getVersion()); } processTaskRelationLog.setCreateTime(now); processTaskRelationLog.setUpdateTime(now); processTaskRelationLog.setOperator(operator.getId()); processTaskRelationLog.setOperateTime(now); } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); if (!processTaskRelationList.isEmpty()) { Set<Integer> processTaskRelationSet = processTaskRelationList.stream().map(ProcessTaskRelation::hashCode).collect(toSet()); Set<Integer> taskRelationSet = taskRelationList.stream().map(ProcessTaskRelationLog::hashCode).collect(toSet()); if (CollectionUtils.isEqualCollection(processTaskRelationSet, taskRelationSet)) { return Constants.EXIT_CODE_SUCCESS; } processTaskRelationMapper.deleteByCode(projectCode, processDefinitionCode); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
int result = processTaskRelationMapper.batchInsert(taskRelationList); int resultLog = processTaskRelationLogMapper.batchInsert(taskRelationList); return (result & resultLog) > 0 ? Constants.EXIT_CODE_SUCCESS : Constants.EXIT_CODE_FAILURE; } public boolean isTaskOnline(long taskCode) { List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByTaskCode(taskCode); if (!processTaskRelationList.isEmpty()) { Set<Long> processDefinitionCodes = processTaskRelationList .stream() .map(ProcessTaskRelation::getProcessDefinitionCode) .collect(Collectors.toSet()); List<ProcessDefinition> processDefinitionList = processDefineMapper.queryByCodes(processDefinitionCodes); // for (ProcessDefinition processDefinition : processDefinitionList) { if (processDefinition.getReleaseState() == ReleaseState.ONLINE) { return true; } } } return false; } /** * Generate the DAG Graph based on the process definition id * * @param processDefinition process definition * @return dag graph */ public DAG<String, TaskNode, TaskNodeRelation> genDagGraph(ProcessDefinition processDefinition) { List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(processDefinition.getProjectCode(), processDefinition.getCode()); List<TaskNode> taskNodeList = transformTask(processTaskRelations, Lists.newArrayList());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessDag processDag = DagHelper.getProcessDag(taskNodeList, new ArrayList<>(processTaskRelations)); // return DagHelper.buildDagGraph(processDag); } /** * generate DagData */ public DagData genDagData(ProcessDefinition processDefinition) { List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(processDefinition.getProjectCode(), processDefinition.getCode()); List<TaskDefinitionLog> taskDefinitionLogList = genTaskDefineList(processTaskRelations); List<TaskDefinition> taskDefinitions = taskDefinitionLogList.stream() .map(taskDefinitionLog -> JSONUtils.parseObject(JSONUtils.toJsonString(taskDefinitionLog), TaskDefinition.class)) .collect(Collectors.toList()); return new DagData(processDefinition, processTaskRelations, taskDefinitions); } public List<TaskDefinitionLog> genTaskDefineList(List<ProcessTaskRelation> processTaskRelations) { Set<TaskDefinition> taskDefinitionSet = new HashSet<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { if (processTaskRelation.getPreTaskCode() > 0) { taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPreTaskCode(), processTaskRelation.getPreTaskVersion())); } if (processTaskRelation.getPostTaskCode() > 0) { taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion())); } } return taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet); } /** * find task definition by code and version */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public TaskDefinition findTaskDefinition(long taskCode, int taskDefinitionVersion) { return taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, taskDefinitionVersion); } /** * find process task relation list by projectCode and processDefinitionCode */ public List<ProcessTaskRelation> findRelationByCode(long projectCode, long processDefinitionCode) { return processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); } /** * add authorized resources * * @param ownResources own resources * @param userId userId */ private void addAuthorizedResources(List<Resource> ownResources, int userId) { List<Integer> relationResourceIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, 7); List<Resource> relationResources = CollectionUtils.isNotEmpty(relationResourceIds) ? resourceMapper.queryResourceListById(relationResourceIds) : new ArrayList<>(); ownResources.addAll(relationResources); } /** * Use temporarily before refactoring taskNode */ public List<TaskNode> transformTask(List<ProcessTaskRelation> taskRelationList, List<TaskDefinitionLog> taskDefinitionLogs) { Map<Long, List<Long>> taskCodeMap = new HashMap<>(); for (ProcessTaskRelation processTaskRelation : taskRelationList) { taskCodeMap.compute(processTaskRelation.getPostTaskCode(), (k, v) -> { if (v == null) { v = new ArrayList<>(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (processTaskRelation.getPreTaskCode() != 0L) { v.add(processTaskRelation.getPreTaskCode()); } return v; }); } if (CollectionUtils.isEmpty(taskDefinitionLogs)) { taskDefinitionLogs = genTaskDefineList(taskRelationList); } Map<Long, TaskDefinitionLog> taskDefinitionLogMap = taskDefinitionLogs.stream() .collect(Collectors.toMap(TaskDefinitionLog::getCode, taskDefinitionLog -> taskDefinitionLog)); List<TaskNode> taskNodeList = new ArrayList<>(); for (Entry<Long, List<Long>> code : taskCodeMap.entrySet()) { TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMap.get(code.getKey()); if (taskDefinitionLog != null) { TaskNode taskNode = new TaskNode(); taskNode.setCode(taskDefinitionLog.getCode()); taskNode.setVersion(taskDefinitionLog.getVersion()); taskNode.setName(taskDefinitionLog.getName()); taskNode.setDesc(taskDefinitionLog.getDescription()); taskNode.setType(taskDefinitionLog.getTaskType().toUpperCase()); taskNode.setRunFlag(taskDefinitionLog.getFlag() == Flag.YES ? Constants.FLOWNODE_RUN_FLAG_NORMAL : Constants.FLOWNODE_RUN_FLAG_FORBIDDEN); taskNode.setMaxRetryTimes(taskDefinitionLog.getFailRetryTimes()); taskNode.setRetryInterval(taskDefinitionLog.getFailRetryInterval()); Map<String, Object> taskParamsMap = taskNode.taskParamsToJsonObj(taskDefinitionLog.getTaskParams()); taskNode.setConditionResult(JSONUtils.toJsonString(taskParamsMap.get(Constants.CONDITION_RESULT))); taskNode.setSwitchResult(JSONUtils.toJsonString(taskParamsMap.get(Constants.SWITCH_RESULT))); taskNode.setDependence(JSONUtils.toJsonString(taskParamsMap.get(Constants.DEPENDENCE))); taskParamsMap.remove(Constants.CONDITION_RESULT); taskParamsMap.remove(Constants.DEPENDENCE);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,277
[Bug] [Master] tasks submit time error.
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch : dev 10 parallel processing tasks in one DAG, run the DAG, you would find the task's submit-time interval is 5 seconds. ### What you expected to happen the parallel processing tasks submit-time should be the same. ### How to reproduce 10 parallel processing tasks in one DAG. run the dag check the submit-time of the tasks. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6277
https://github.com/apache/dolphinscheduler/pull/6278
540fd9dc0844a4e44dc5485d6001eb0dd18c8257
649723132bc8276ef221c37e7014c0cf6772be60
"2021-09-20T04:03:32Z"
java
"2021-09-20T06:57:53Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskNode.setParams(JSONUtils.toJsonString(taskParamsMap)); taskNode.setTaskInstancePriority(taskDefinitionLog.getTaskPriority()); taskNode.setWorkerGroup(taskDefinitionLog.getWorkerGroup()); taskNode.setEnvironmentCode(taskDefinitionLog.getEnvironmentCode()); taskNode.setTimeout(JSONUtils.toJsonString(new TaskTimeoutParameter(taskDefinitionLog.getTimeoutFlag() == TimeoutFlag.OPEN, taskDefinitionLog.getTimeoutNotifyStrategy(), taskDefinitionLog.getTimeout()))); taskNode.setDelayTime(taskDefinitionLog.getDelayTime()); taskNode.setPreTasks(JSONUtils.toJsonString(code.getValue().stream().map(taskDefinitionLogMap::get).map(TaskDefinition::getName).collect(Collectors.toList()))); taskNodeList.add(taskNode); } } return taskNodeList; } public Map<ProcessInstance, TaskInstance> notifyProcessList(int processId, int taskId) { HashMap<ProcessInstance, TaskInstance> processTaskMap = new HashMap<>(); // ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryBySubProcessId(processId); if (processInstanceMap == null) { return processTaskMap; } ProcessInstance fatherProcess = this.findProcessInstanceById(processInstanceMap.getParentProcessInstanceId()); TaskInstance fatherTask = this.findTaskInstanceById(processInstanceMap.getParentTaskInstanceId()); if (fatherProcess != null) { processTaskMap.put(fatherProcess, fatherTask); } return processTaskMap; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/* * Lcensed to the Apache Software Foundaton (ASF) under one or more * contrbutor lcense agreements. See the NOTICE fle dstrbuted wth * ths work for addtonal nformaton regardng copyrght ownershp. * The ASF lcenses ths fle to You under the Apache Lcense, Verson 2.0 * (the "Lcense"); you may not use ths fle except n complance wth * the Lcense. You may obtan a copy of the Lcense at * * http://www.apache.org/lcenses/LICENSE-2.0 * * Unless requred by applcable law or agreed to n wrtng, software * dstrbuted under the Lcense s dstrbuted on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ether express or mpled. * See the Lcense for the specfc language governng permssons and * lmtatons under the Lcense. */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
package org.apache.dolphnscheduler.server.master.runner; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_START_NODE_NAMES; mport statc org.apache.dolphnscheduler.common.Constants.DEFAULT_WORKER_GROUP; mport statc org.apache.dolphnscheduler.common.Constants.SEC_2_MINUTES_TIME_UNIT; mport org.apache.dolphnscheduler.common.Constants; mport org.apache.dolphnscheduler.common.enums.CommandType; mport org.apache.dolphnscheduler.common.enums.DependResult; mport org.apache.dolphnscheduler.common.enums.Drect; mport org.apache.dolphnscheduler.common.enums.ExecutonStatus; mport org.apache.dolphnscheduler.common.enums.FalureStrategy; mport org.apache.dolphnscheduler.common.enums.Flag; mport org.apache.dolphnscheduler.common.enums.Prorty; mport org.apache.dolphnscheduler.common.enums.StateEvent; mport org.apache.dolphnscheduler.common.enums.StateEventType; mport org.apache.dolphnscheduler.common.enums.TaskDependType; mport org.apache.dolphnscheduler.common.enums.TaskTmeoutStrategy; mport org.apache.dolphnscheduler.common.enums.TmeoutFlag; mport org.apache.dolphnscheduler.common.graph.DAG; mport org.apache.dolphnscheduler.common.model.TaskNode; mport org.apache.dolphnscheduler.common.model.TaskNodeRelaton; mport org.apache.dolphnscheduler.common.process.ProcessDag; mport org.apache.dolphnscheduler.common.process.Property; mport org.apache.dolphnscheduler.common.thread.ThreadUtls; mport org.apache.dolphnscheduler.common.utls.CollectonUtls; mport org.apache.dolphnscheduler.common.utls.DateUtls; mport org.apache.dolphnscheduler.common.utls.JSONUtls; mport org.apache.dolphnscheduler.common.utls.NetUtls;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport org.apache.dolphnscheduler.common.utls.ParameterUtls; mport org.apache.dolphnscheduler.dao.entty.Envronment; mport org.apache.dolphnscheduler.dao.entty.ProcessDefnton; mport org.apache.dolphnscheduler.dao.entty.ProcessInstance; mport org.apache.dolphnscheduler.dao.entty.ProjectUser; mport org.apache.dolphnscheduler.dao.entty.Schedule; mport org.apache.dolphnscheduler.dao.entty.TaskDefnton; mport org.apache.dolphnscheduler.dao.entty.TaskInstance; mport org.apache.dolphnscheduler.dao.utls.DagHelper; mport org.apache.dolphnscheduler.remote.command.HostUpdateCommand; mport org.apache.dolphnscheduler.remote.utls.Host; mport org.apache.dolphnscheduler.server.master.confg.MasterConfg; mport org.apache.dolphnscheduler.server.master.dspatch.executor.NettyExecutorManager; mport org.apache.dolphnscheduler.server.master.runner.task.ITaskProcessor; mport org.apache.dolphnscheduler.server.master.runner.task.TaskActon; mport org.apache.dolphnscheduler.server.master.runner.task.TaskProcessorFactory; mport org.apache.dolphnscheduler.servce.alert.ProcessAlertManager; mport org.apache.dolphnscheduler.servce.process.ProcessServce; mport org.apache.dolphnscheduler.servce.quartz.cron.CronUtls; mport org.apache.dolphnscheduler.servce.queue.PeerTaskInstancePrortyQueue; mport org.apache.commons.lang.StrngUtls; mport java.utl.ArrayLst; mport java.utl.Arrays; mport java.utl.Collecton; mport java.utl.Date; mport java.utl.HashMap; mport java.utl.Iterator; mport java.utl.Lst; mport java.utl.Map; mport java.utl.Objects;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport java.utl.Set; mport java.utl.concurrent.ConcurrentHashMap; mport java.utl.concurrent.ConcurrentLnkedQueue; mport java.utl.concurrent.ExecutorServce; mport org.slf4j.Logger; mport org.slf4j.LoggerFactory; mport com.google.common.collect.HashBasedTable; mport com.google.common.collect.Lsts; mport com.google.common.collect.Table; /** * master exec thread,splt dag */ publc class WorkflowExecuteThread mplements Runnable { /** * logger of WorkflowExecuteThread */ prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteThread.class); /** * runng TaskNode */ prvate fnal Map<Integer, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>(); /** * task exec servce */ prvate fnal ExecutorServce taskExecServce; /** * process nstance */ prvate ProcessInstance processInstance; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* submt falure nodes */ prvate boolean taskFaledSubmt = false; /** * recover node d lst */ prvate Lst<TaskInstance> recoverNodeIdLst = new ArrayLst<>(); /** * error task lst */ prvate Map<Strng, TaskInstance> errorTaskLst = new ConcurrentHashMap<>(); /** * complete task lst */ prvate Map<Strng, TaskInstance> completeTaskLst = new ConcurrentHashMap<>(); /** * ready to submt task queue */ prvate PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue(); /** * depend faled task map */ prvate Map<Strng, TaskInstance> dependFaledTask = new ConcurrentHashMap<>(); /** * forbdden task map */ prvate Map<Strng, TaskNode> forbddenTaskLst = new ConcurrentHashMap<>(); /** * skp task map */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate Map<Strng, TaskNode> skpTaskNodeLst = new ConcurrentHashMap<>(); /** * recover tolerance fault task lst */ prvate Lst<TaskInstance> recoverToleranceFaultTaskLst = new ArrayLst<>(); /** * alert manager */ prvate ProcessAlertManager processAlertManager; /** * the object of DAG */ prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag; /** * process servce */ prvate ProcessServce processServce; /** * master confg */ prvate MasterConfg masterConfg; /** * */ prvate NettyExecutorManager nettyExecutorManager; prvate ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>(); prvate Lst<Date> complementLstDate = Lsts.newLnkedLst(); prvate Table<Integer, Long, TaskInstance> taskInstanceHashMap = HashBasedTable.create(); prvate ProcessDefnton processDefnton; prvate Strng key;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst; /** * constructor of WorkflowExecuteThread * * @param processInstance processInstance * @param processServce processServce * @param nettyExecutorManager nettyExecutorManager * @param taskTmeoutCheckLst */ publc WorkflowExecuteThread(ProcessInstance processInstance , ProcessServce processServce , NettyExecutorManager nettyExecutorManager , ProcessAlertManager processAlertManager , MasterConfg masterConfg , ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst) { ths.processServce = processServce; ths.processInstance = processInstance; ths.masterConfg = masterConfg; nt masterTaskExecNum = masterConfg.getMasterExecTaskNum(); ths.taskExecServce = ThreadUtls.newDaemonFxedThreadExecutor("Master-Task-Exec-Thread", masterTaskExecNum); ths.nettyExecutorManager = nettyExecutorManager; ths.processAlertManager = processAlertManager; ths.taskTmeoutCheckLst = taskTmeoutCheckLst; } @Overrde publc vod run() { try { startProcess(); handleEvents();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} catch (Excepton e) { logger.error("handler error:", e); } } prvate vod handleEvents() { whle (ths.stateEvents.sze() > 0) { try { StateEvent stateEvent = ths.stateEvents.peek(); f (stateEventHandler(stateEvent)) { ths.stateEvents.remove(stateEvent); } } catch (Excepton e) { logger.error("state handle error:", e); } } } publc Strng getKey() { f (StrngUtls.sNotEmpty(key) || ths.processDefnton == null) { return key; } key = Strng.format("{}_{}_{}", ths.processDefnton.getCode(), ths.processDefnton.getVerson(), ths.processInstance.getId()); return key; } publc boolean addStateEvent(StateEvent stateEvent) { f (processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.nfo("state event would be abounded :{}", stateEvent.toStrng());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return false; } ths.stateEvents.add(stateEvent); return true; } publc nt eventSze() { return ths.stateEvents.sze(); } publc ProcessInstance getProcessInstance() { return ths.processInstance; } prvate boolean stateEventHandler(StateEvent stateEvent) { logger.nfo("process event: {}", stateEvent.toStrng()); f (!checkStateEvent(stateEvent)) { return false; } boolean result = false; swtch (stateEvent.getType()) { case PROCESS_STATE_CHANGE: result = processStateChangeHandler(stateEvent); break; case TASK_STATE_CHANGE: result = taskStateChangeHandler(stateEvent); break; case PROCESS_TIMEOUT: result = processTmeout(); break; case TASK_TIMEOUT: result = taskTmeout(stateEvent); break;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
default: break; } f (result) { ths.stateEvents.remove(stateEvent); } return result; } prvate boolean taskTmeout(StateEvent stateEvent) { f (taskInstanceHashMap.contansRow(stateEvent.getTaskInstanceId())) { return true; } TaskInstance taskInstance = taskInstanceHashMap .row(stateEvent.getTaskInstanceId()) .values() .terator().next(); f (TmeoutFlag.CLOSE == taskInstance.getTaskDefne().getTmeoutFlag()) { return true; } TaskTmeoutStrategy taskTmeoutStrategy = taskInstance.getTaskDefne().getTmeoutNotfyStrategy(); f (TaskTmeoutStrategy.FAILED == taskTmeoutStrategy) { ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); taskProcessor.acton(TaskActon.TIMEOUT); return false; } else { processAlertManager.sendTaskTmeoutAlert(processInstance, taskInstance, taskInstance.getTaskDefne()); return true; } } prvate boolean processTmeout() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
ths.processAlertManager.sendProcessTmeoutAlert(ths.processInstance, ths.processDefnton); return true; } prvate boolean taskStateChangeHandler(StateEvent stateEvent) { TaskInstance task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId()); f (stateEvent.getExecutonStatus().typeIsFnshed()) { taskFnshed(task); } else f (actveTaskProcessorMaps.contansKey(stateEvent.getTaskInstanceId())) { ITaskProcessor TaskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); TaskProcessor.run(); f (TaskProcessor.taskState().typeIsFnshed()) { task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId()); taskFnshed(task); } } else { logger.error("state handler error: {}", stateEvent.toStrng()); } return true; } prvate vod taskFnshed(TaskInstance task) { logger.nfo("work flow {} task {} state:{} ", processInstance.getId(), task.getId(), task.getState()); f (task.taskCanRetry()) { addTaskToStandByLst(task); return; } ProcessInstance processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); completeTaskLst.put(task.getName(), task);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
actveTaskProcessorMaps.remove(task.getId()); taskTmeoutCheckLst.remove(task.getId()); f (task.getState().typeIsSuccess()) { processInstance.setVarPool(task.getVarPool()); processServce.saveProcessInstance(processInstance); submtPostNode(task.getName()); } else f (task.getState().typeIsFalure()) { f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(task.getName(), dag)) { submtPostNode(task.getName()); } else { errorTaskLst.put(task.getName(), task); f (processInstance.getFalureStrategy() == FalureStrategy.END) { kllAllTasks(); } } } ths.updateProcessInstanceState(); } prvate boolean checkStateEvent(StateEvent stateEvent) { f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.error("msmatch process nstance d: {}, state event:{}", ths.processInstance.getId(), stateEvent.toStrng()); return false; } return true; } prvate boolean processStateChangeHandler(StateEvent stateEvent) { try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.nfo("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutonStatus()); processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); f (processComplementData()) { return true; } f (stateEvent.getExecutonStatus().typeIsFnshed()) { endProcess(); } f (stateEvent.getExecutonStatus() == ExecutonStatus.READY_STOP) { kllAllTasks(); } return true; } catch (Excepton e) { logger.error("process state change error:", e); } return true; } prvate boolean processComplementData() throws Excepton { f (!needComplementProcess()) { return false; } Date scheduleDate = processInstance.getScheduleTme(); f (scheduleDate == null) { scheduleDate = complementLstDate.get(0); } else f (processInstance.getState().typeIsFnshed()) { endProcess(); nt ndex = complementLstDate.ndexOf(scheduleDate); f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().typeIsSuccess()) { return false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} scheduleDate = complementLstDate.get(ndex + 1); processInstance.setId(0); } processInstance.setScheduleTme(scheduleDate); Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam.contansKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); processInstance.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); } processInstance.setState(ExecutonStatus.RUNNING_EXECUTION); processInstance.setGlobalParams(ParameterUtls.curngGlobalParams( processDefnton.getGlobalParamMap(), processDefnton.getGlobalParamLst(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme())); processInstance.setStartTme(new Date()); processInstance.setEndTme(null); processServce.saveProcessInstance(processInstance); ths.taskInstanceHashMap.clear(); startProcess(); return true; } prvate boolean needComplementProcess() { f (processInstance.sComplementData() && Flag.NO == processInstance.getIsSubProcess()) { return true; } return false; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate vod startProcess() throws Excepton { buldFlowDag(); f (ths.taskInstanceHashMap.sze() == 0) { ntTaskQueue(); submtPostNode(null); } } /** * process end handle */ prvate vod endProcess() { ths.stateEvents.clear(); processInstance.setEndTme(new Date()); processServce.updateProcessInstance(processInstance); f (processInstance.getState().typeIsWatngThread()) { processServce.createRecoveryWatngThreadCommand(null, processInstance); } Lst<TaskInstance> taskInstances = processServce.fndValdTaskLstByProcessId(processInstance.getId()); ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendAlertProcessInstance(processInstance, taskInstances, projectUser); } /** * generate process dag * * @throws Excepton excepton */ prvate vod buldFlowDag() throws Excepton { f (ths.dag != null) { return; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(), processInstance.getProcessDefntonVerson()); recoverNodeIdLst = getStartTaskInstanceLst(processInstance.getCommandParam()); Lst<TaskNode> taskNodeLst = processServce.transformTask(processServce.fndRelatonByCode(processDefnton.getProjectCode(), processDefnton.getCode()), Lsts.newArrayLst()); forbddenTaskLst.clear(); taskNodeLst.forEach(taskNode -> { f (taskNode.sForbdden()) { forbddenTaskLst.put(taskNode.getName(), taskNode); } }); Lst<Strng> recoveryNameLst = getRecoveryNodeNameLst(); Lst<Strng> startNodeNameLst = parseStartNodeName(processInstance.getCommandParam()); ProcessDag processDag = generateFlowDag(taskNodeLst, startNodeNameLst, recoveryNameLst, processInstance.getTaskDependType()); f (processDag == null) { logger.error("processDag s null"); return; } dag = DagHelper.buldDagGraph(processDag); } /** * nt task queue */ prvate vod ntTaskQueue() { taskFaledSubmt = false; actveTaskProcessorMaps.clear(); dependFaledTask.clear();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
completeTaskLst.clear(); errorTaskLst.clear(); Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(processInstance.getId()); for (TaskInstance task : taskInstanceLst) { f (task.sTaskComplete()) { completeTaskLst.put(task.getName(), task); } f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(task.getName(), dag)) { contnue; } f (task.getState().typeIsFalure() && !task.taskCanRetry()) { errorTaskLst.put(task.getName(), task); } } f (complementLstDate.sze() == 0 && needComplementProcess()) { Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); Date startDate = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Date endDate = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); f (startDate.after(endDate)) { Date tmp = startDate; startDate = endDate; endDate = tmp; } Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode(processInstance.getProcessDefntonCode()); complementLstDate.addAll(CronUtls.getSelfFreDateLst(startDate, endDate, schedules)); logger.nfo(" process defnton code:{} complement data: {}", processInstance.getProcessDefntonCode(), complementLstDate.toStrng()); } } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* submt task to execute * * @param taskInstance task nstance * @return TaskInstance */ prvate TaskInstance submtTaskExec(TaskInstance taskInstance) { try { ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType()); f (taskInstance.getState() == ExecutonStatus.RUNNING_EXECUTION && taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) { notfyProcessHostUpdate(taskInstance); } boolean submt = taskProcessor.submt(taskInstance, processInstance, masterConfg.getMasterTaskCommtRetryTmes(), masterConfg.getMasterTaskCommtInterval()); f (submt) { ths.taskInstanceHashMap.put(taskInstance.getId(), taskInstance.getTaskCode(), taskInstance); actveTaskProcessorMaps.put(taskInstance.getId(), taskProcessor); taskProcessor.run(); addTmeoutCheck(taskInstance); TaskDefnton taskDefnton = processServce.fndTaskDefnton( taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson()); taskInstance.setTaskDefne(taskDefnton); f (taskProcessor.taskState().typeIsFnshed()) { StateEvent stateEvent = new StateEvent(); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setExecutonStatus(taskProcessor.taskState()); stateEvent.setType(StateEventType.TASK_STATE_CHANGE); ths.stateEvents.add(stateEvent); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return taskInstance; } else { logger.error("process d:{} name:{} submt standby task d:{} name:{} faled!", processInstance.getId(), processInstance.getName(), taskInstance.getId(), taskInstance.getName()); return null; } } catch (Excepton e) { logger.error("submt standby task error", e); return null; } } prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) { f (StrngUtls.sEmpty(taskInstance.getHost())) { return; } try { HostUpdateCommand hostUpdateCommand = new HostUpdateCommand(); hostUpdateCommand.setProcessHost(NetUtls.getAddr(masterConfg.getLstenPort())); hostUpdateCommand.setTaskInstanceId(taskInstance.getId()); Host host = new Host(taskInstance.getHost()); nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command()); } catch (Excepton e) { logger.error("notfy process host update", e); } } prvate vod addTmeoutCheck(TaskInstance taskInstance) { TaskDefnton taskDefnton = processServce.fndTaskDefnton( taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson()
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
); taskInstance.setTaskDefne(taskDefnton); f (TmeoutFlag.OPEN == taskDefnton.getTmeoutFlag()) { ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance); return; } f (taskInstance.sDependTask() || taskInstance.sSubProcess()) { ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance); } } /** * fnd task nstance n db. * n case submt more than one same name task n the same tme. * * @param taskCode task code * @param taskVerson task verson * @return TaskInstance */ prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) { Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(ths.processInstance.getId()); for (TaskInstance taskInstance : taskInstanceLst) { f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) { return taskInstance; } } return null; } /** * encapsulaton task *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @param processInstance process nstance * @param taskNode taskNode * @return TaskInstance */ prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) { TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson()); f (taskInstance == null) { taskInstance = new TaskInstance(); taskInstance.setTaskCode(taskNode.getCode()); taskInstance.setTaskDefntonVerson(taskNode.getVerson()); taskInstance.setName(taskNode.getName()); taskInstance.setState(ExecutonStatus.SUBMITTED_SUCCESS); taskInstance.setProcessInstanceId(processInstance.getId()); taskInstance.setTaskType(taskNode.getType().toUpperCase()); taskInstance.setAlertFlag(Flag.NO); taskInstance.setStartTme(null); taskInstance.setFlag(Flag.YES); taskInstance.setRetryTmes(0); taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes()); taskInstance.setRetryInterval(taskNode.getRetryInterval());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
taskInstance.setTaskParams(taskNode.getTaskParams()); f (taskNode.getTaskInstanceProrty() == null) { taskInstance.setTaskInstanceProrty(Prorty.MEDIUM); } else { taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty()); } Strng processWorkerGroup = processInstance.getWorkerGroup(); processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup; Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup(); Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode(); Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode(); f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { taskInstance.setWorkerGroup(processWorkerGroup); taskInstance.setEnvronmentCode(processEnvronmentCode); } else { taskInstance.setWorkerGroup(taskWorkerGroup); taskInstance.setEnvronmentCode(taskEnvronmentCode); } f (!taskInstance.getEnvronmentCode().equals(-1L)) { Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode()); f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) { taskInstance.setEnvronmentConfg(envronment.getConfg()); } } taskInstance.setDelayTme(taskNode.getDelayTme()); } return taskInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) { Map<Strng, Property> allProperty = new HashMap<>(); Map<Strng, TaskInstance> allTaskInstance = new HashMap<>(); f (CollectonUtls.sNotEmpty(preTask)) { for (Strng preTaskName : preTask) { TaskInstance preTaskInstance = completeTaskLst.get(preTaskName); f (preTaskInstance == null) { contnue; } Strng preVarPool = preTaskInstance.getVarPool(); f (StrngUtls.sNotEmpty(preVarPool)) { Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class); for (Property nfo : propertes) { setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo); } } } f (allProperty.sze() > 0) { taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values())); } } } prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) { thsProperty.setDrect(Drect.IN); Strng proName = thsProperty.getProp(); f (allProperty.contansKey(proName)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
Property otherPro = allProperty.get(proName); f (StrngUtls.sEmpty(thsProperty.getValue())) { allProperty.put(proName, otherPro); } else f (StrngUtls.sNotEmpty(otherPro.getValue())) { TaskInstance otherTask = allTaskInstance.get(proName); f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } else { allProperty.put(proName, otherPro); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } prvate vod submtPostNode(Strng parentNodeName) { Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeName, skpTaskNodeLst, dag, completeTaskLst); Lst<TaskInstance> taskInstances = new ArrayLst<>(); for (Strng taskNode : submtTaskNodeLst) { TaskNode taskNodeObject = dag.getNode(taskNode); f (taskInstanceHashMap.contansColumn(taskNodeObject.getCode())) { contnue;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} TaskInstance task = createTaskInstance(processInstance, taskNodeObject); taskInstances.add(task); } for (TaskInstance task : taskInstances) { f (readyToSubmtTaskQueue.contans(task)) { contnue; } f (completeTaskLst.contansKey(task.getName())) { logger.nfo("task {} has already run success", task.getName()); contnue; } f (task.getState().typeIsPause() || task.getState().typeIsCancel()) { logger.nfo("task {} stopped, the state s {}", task.getName(), task.getState()); } else { addTaskToStandByLst(task); } } submtStandByTask(); updateProcessInstanceState(); } /** * determne whether the dependences of the task node are complete * * @return DependResult */ prvate DependResult sTaskDepsComplete(Strng taskName) { Collecton<Strng> startNodes = dag.getBegnNode();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (startNodes.contans(taskName)) { return DependResult.SUCCESS; } TaskNode taskNode = dag.getNode(taskName); Lst<Strng> depNameLst = taskNode.getDepLst(); for (Strng depsNode : depNameLst) { f (!dag.contansNode(depsNode) || forbddenTaskLst.contansKey(depsNode) || skpTaskNodeLst.contansKey(depsNode)) { contnue; } f (!completeTaskLst.contansKey(depsNode)) { return DependResult.WAITING; } ExecutonStatus depTaskState = completeTaskLst.get(depsNode).getState(); f (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) { return DependResult.NON_EXEC; } f (taskNode.sCondtonsTask()) { contnue; } f (!dependTaskSuccess(depsNode, taskName)) { return DependResult.FAILED; } } logger.nfo("taskName: {} completeDependTaskLst: {}", taskName, Arrays.toStrng(completeTaskLst.keySet().toArray())); return DependResult.SUCCESS; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * depend node s completed, but here need check the condton task branch s the next node */ prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) { f (dag.getNode(dependNodeName).sCondtonsTask()) { Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeLst, dag, completeTaskLst); f (!nextTaskLst.contans(nextNodeName)) { return false; } } else { ExecutonStatus depTaskState = completeTaskLst.get(dependNodeName).getState(); f (depTaskState.typeIsFalure()) { return false; } } return true; } /** * query task nstance by complete state * * @param state state * @return task nstance lst */ prvate Lst<TaskInstance> getCompleteTaskByState(ExecutonStatus state) { Lst<TaskInstance> resultLst = new ArrayLst<>(); for (Map.Entry<Strng, TaskInstance> entry : completeTaskLst.entrySet()) { f (entry.getValue().getState() == state) { resultLst.add(entry.getValue()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} return resultLst; } /** * where there are ongong tasks * * @param state state * @return ExecutonStatus */ prvate ExecutonStatus runnngState(ExecutonStatus state) { f (state == ExecutonStatus.READY_STOP || state == ExecutonStatus.READY_PAUSE || state == ExecutonStatus.WAITING_THREAD || state == ExecutonStatus.DELAY_EXECUTION) { return state; } else { return ExecutonStatus.RUNNING_EXECUTION; } } /** * exsts falure task,contans submt falure、dependency falure,execute falure(retry after) * * @return Boolean whether has faled task */ prvate boolean hasFaledTask() { f (ths.taskFaledSubmt) { return true; } f (ths.errorTaskLst.sze() > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return true; } return ths.dependFaledTask.sze() > 0; } /** * process nstance falure * * @return Boolean whether process nstance faled */ prvate boolean processFaled() { f (hasFaledTask()) { f (processInstance.getFalureStrategy() == FalureStrategy.END) { return true; } f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE) { return readyToSubmtTaskQueue.sze() == 0 || actveTaskProcessorMaps.sze() == 0; } } return false; } /** * whether task for watng thread * * @return Boolean whether has watng thread task */ prvate boolean hasWatngThreadTask() { Lst<TaskInstance> watngLst = getCompleteTaskByState(ExecutonStatus.WAITING_THREAD); return CollectonUtls.sNotEmpty(watngLst); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* prepare for pause * 1,faled retry task n the preparaton queue , returns to falure drectly * 2,exsts pause task,complement not completed, pendng submsson of tasks, return to suspenson * 3,success * * @return ExecutonStatus */ prvate ExecutonStatus processReadyPause() { f (hasRetryTaskInStandBy()) { return ExecutonStatus.FAILURE; } Lst<TaskInstance> pauseLst = getCompleteTaskByState(ExecutonStatus.PAUSE); f (CollectonUtls.sNotEmpty(pauseLst) || !sComplementEnd() || readyToSubmtTaskQueue.sze() > 0) { return ExecutonStatus.PAUSE; } else { return ExecutonStatus.SUCCESS; } } /** * generate the latest process nstance status by the tasks state * * @param nstance * @return process nstance executon status */ prvate ExecutonStatus getProcessInstanceState(ProcessInstance nstance) { ExecutonStatus state = nstance.getState(); f (actveTaskProcessorMaps.sze() > 0 || hasRetryTaskInStandBy()) { // actve
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return runnngState(state); } // process falure f (processFaled()) { return ExecutonStatus.FAILURE; } // watng thread f (hasWatngThreadTask()) { return ExecutonStatus.WAITING_THREAD; } // pause f (state == ExecutonStatus.READY_PAUSE) { return processReadyPause(); } // stop f (state == ExecutonStatus.READY_STOP) { Lst<TaskInstance> stopLst = getCompleteTaskByState(ExecutonStatus.STOP); Lst<TaskInstance> kllLst = getCompleteTaskByState(ExecutonStatus.KILL); f (CollectonUtls.sNotEmpty(stopLst) || CollectonUtls.sNotEmpty(kllLst) || !sComplementEnd()) { return ExecutonStatus.STOP; } else { return ExecutonStatus.SUCCESS; } } // success f (state == ExecutonStatus.RUNNING_EXECUTION) { Lst<TaskInstance> kllTasks = getCompleteTaskByState(ExecutonStatus.KILL); f (readyToSubmtTaskQueue.sze() > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
//tasks cu return ExecutonStatus.RUNNING_EXECUTION; } else f (CollectonUtls.sNotEmpty(kllTasks)) { // tasks m return ExecutonStatus.FAILURE; } else { // f the return ExecutonStatus.SUCCESS; } } return state; } /** * whether complement end * * @return Boolean whether s complement end */ prvate boolean sComplementEnd() { f (!processInstance.sComplementData()) { return true; } try { Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); Date endTme = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); return processInstance.getScheduleTme().equals(endTme); } catch (Excepton e) { logger.error("complement end faled ", e); return false; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * updateProcessInstance process nstance state * after each batch of tasks s executed, the status of the process nstance s updated */ prvate vod updateProcessInstanceState() { ProcessInstance nstance = processServce.fndProcessInstanceById(processInstance.getId()); ExecutonStatus state = getProcessInstanceState(nstance); f (processInstance.getState() != state) { logger.nfo( "work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}", processInstance.getId(), processInstance.getName(), processInstance.getState(), state, processInstance.getCommandType()); nstance.setState(state); processServce.updateProcessInstance(nstance); processInstance = nstance; StateEvent stateEvent = new StateEvent(); stateEvent.setExecutonStatus(processInstance.getState()); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE); ths.processStateChangeHandler(stateEvent); } } /** * get task dependency result * * @param taskInstance task nstance * @return DependResult */ prvate DependResult getDependResultForTask(TaskInstance taskInstance) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return sTaskDepsComplete(taskInstance.getName()); } /** * add task to standby lst * * @param taskInstance task nstance */ prvate vod addTaskToStandByLst(TaskInstance taskInstance) { logger.nfo("add task to stand by lst: {}", taskInstance.getName()); try { readyToSubmtTaskQueue.put(taskInstance); } catch (Excepton e) { logger.error("add task nstance to readyToSubmtTaskQueue error, taskName: {}", taskInstance.getName(), e); } } /** * remove task from stand by lst * * @param taskInstance task nstance */ prvate vod removeTaskFromStandbyLst(TaskInstance taskInstance) { logger.nfo("remove task from stand by lst, d: {} name:{}", taskInstance.getId(), taskInstance.getName()); try { readyToSubmtTaskQueue.remove(taskInstance); } catch (Excepton e) { logger.error("remove task nstance from readyToSubmtTaskQueue error, task d:{}, Name: {}", taskInstance.getId(), taskInstance.getName(), e);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} } /** * has retry task n standby * * @return Boolean whether has retry task n standby */ prvate boolean hasRetryTaskInStandBy() { for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) { f (ter.next().getState().typeIsFalure()) { return true; } } return false; } /** * close the on gong tasks */ prvate vod kllAllTasks() { logger.nfo("kll called on process nstance d: {}, num: {}", processInstance.getId(), actveTaskProcessorMaps.sze()); for (nt taskId : actveTaskProcessorMaps.keySet()) { TaskInstance taskInstance = processServce.fndTaskInstanceById(taskId); f (taskInstance == null || taskInstance.getState().typeIsFnshed()) { contnue; } ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskId); taskProcessor.acton(TaskActon.STOP); f (taskProcessor.taskState().typeIsFnshed()) { StateEvent stateEvent = new StateEvent();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
stateEvent.setType(StateEventType.TASK_STATE_CHANGE); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setExecutonStatus(taskProcessor.taskState()); ths.addStateEvent(stateEvent); } } } publc boolean workFlowFnsh() { return ths.processInstance.getState().typeIsFnshed(); } /** * whether the retry nterval s tmed out * * @param taskInstance task nstance * @return Boolean */ prvate boolean retryTaskIntervalOverTme(TaskInstance taskInstance) { f (taskInstance.getState() != ExecutonStatus.FAILURE) { return true; } f (taskInstance.getId() == 0 || taskInstance.getMaxRetryTmes() == 0 || taskInstance.getRetryInterval() == 0) { return true; } Date now = new Date(); long faledTmeInterval = DateUtls.dfferSec(now, taskInstance.getEndTme());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
// task retry does not over tme, return false return taskInstance.getRetryInterval() * SEC_2_MINUTES_TIME_UNIT < faledTmeInterval; } /** * handlng the lst of tasks to be submtted */ prvate vod submtStandByTask() { try { nt length = readyToSubmtTaskQueue.sze(); for (nt = 0; < length; ++) { TaskInstance task = readyToSubmtTaskQueue.peek(); f (task == null) { contnue; } // stop ta f (task.taskCanRetry()) { TaskInstance retryTask = processServce.fndTaskInstanceById(task.getId()); f (retryTask != null && retryTask.getState().equals(ExecutonStatus.FORCED_SUCCESS)) { task.setState(retryTask.getState()); logger.nfo("task: {} has been forced success, put t nto complete task lst and stop retryng", task.getName()); removeTaskFromStandbyLst(task); completeTaskLst.put(task.getName(), task); submtPostNode(task.getName()); contnue; } } //nt var f (task.sFrstRun()) { //get pre Set<Strng> preTask = dag.getPrevousNodes(task.getName());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
getPreVarPool(task, preTask); } DependResult dependResult = getDependResultForTask(task); f (DependResult.SUCCESS == dependResult) { f (retryTaskIntervalOverTme(task)) { TaskInstance taskInstance = submtTaskExec(task); f (taskInstance == null) { ths.taskFaledSubmt = true; } else { removeTaskFromStandbyLst(task); } } } else f (DependResult.FAILED == dependResult) { // f the dependFaledTask.put(task.getName(), task); removeTaskFromStandbyLst(task); logger.nfo("task {},d:{} depend result : {}", task.getName(), task.getId(), dependResult); } else f (DependResult.NON_EXEC == dependResult) { // for som removeTaskFromStandbyLst(task); logger.nfo("remove task {},d:{} , because depend result : {}", task.getName(), task.getId(), dependResult); } } } catch (Excepton e) { logger.error("submt standby task error", e); } } /** * get recovery task nstance *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @param taskId task d * @return recovery task nstance */ prvate TaskInstance getRecoveryTaskInstance(Strng taskId) { f (!StrngUtls.sNotEmpty(taskId)) { return null; } try { Integer ntId = Integer.valueOf(taskId); TaskInstance task = processServce.fndTaskInstanceById(ntId); f (task == null) { logger.error("start node d cannot be found: {}", taskId); } else { return task; } } catch (Excepton e) { logger.error("get recovery task nstance faled ", e); } return null; } /** * get start task nstance lst * * @param cmdParam command param * @return task nstance lst */ prvate Lst<TaskInstance> getStartTaskInstanceLst(Strng cmdParam) { Lst<TaskInstance> nstanceLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap != null && paramMap.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
Strng[] dLst = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).splt(Constants.COMMA); for (Strng nodeId : dLst) { TaskInstance task = getRecoveryTaskInstance(nodeId); f (task != null) { nstanceLst.add(task); } } } return nstanceLst; } /** * parse "StartNodeNameLst" from cmd param * * @param cmdParam command param * @return start node name lst */ prvate Lst<Strng> parseStartNodeName(Strng cmdParam) { Lst<Strng> startNodeNameLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap == null) { return startNodeNameLst; } f (paramMap.contansKey(CMD_PARAM_START_NODE_NAMES)) { startNodeNameLst = Arrays.asLst(paramMap.get(CMD_PARAM_START_NODE_NAMES).splt(Constants.COMMA)); } return startNodeNameLst; } /** * generate start node name lst from parsng command param; * f "StartNodeIdLst" exsts n command param, return StartNodeIdLst
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,279
[Bug] [Master] Parallel tasks would be Irregularly submitted twice
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parallels tasks in one DAG, run the dag, the tasks would be Irregularly submitted twice. ### What you expected to happen tasks in one DAG should be submitted once. ### How to reproduce 10 parallel tasks in one DAG. run the DAG, find the tasks submit history, you would find some tasks are submitted twice. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6279
https://github.com/apache/dolphinscheduler/pull/6280
7098855ee0f004b2d291a33f2740ca36edd64dbf
b71967b017f0d4c50f5837a3173ba0f35bf2c077
"2021-09-20T04:24:39Z"
java
"2021-09-21T04:04:31Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* * @return recovery node name lst */ prvate Lst<Strng> getRecoveryNodeNameLst() { Lst<Strng> recoveryNodeNameLst = new ArrayLst<>(); f (CollectonUtls.sNotEmpty(recoverNodeIdLst)) { for (TaskInstance task : recoverNodeIdLst) { recoveryNodeNameLst.add(task.getName()); } } return recoveryNodeNameLst; } /** * generate flow dag * * @param totalTaskNodeLst total task node lst * @param startNodeNameLst start node name lst * @param recoveryNodeNameLst recovery node name lst * @param depNodeType depend node type * @return ProcessDag process dag * @throws Excepton excepton */ publc ProcessDag generateFlowDag(Lst<TaskNode> totalTaskNodeLst, Lst<Strng> startNodeNameLst, Lst<Strng> recoveryNodeNameLst, TaskDependType depNodeType) throws Excepton { return DagHelper.generateFlowDag(totalTaskNodeLst, startNodeNameLst, recoveryNodeNameLst, depNodeType); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* limitations under the License. */ package org.apache.dolphinscheduler.api.service.impl; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_ID; import org.apache.dolphinscheduler.api.dto.DagDataSchedule; import org.apache.dolphinscheduler.api.dto.treeview.Instance; import org.apache.dolphinscheduler.api.dto.treeview.TreeViewDto; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.ProcessDefinitionService; import org.apache.dolphinscheduler.api.service.ProcessInstanceService; import org.apache.dolphinscheduler.api.service.ProjectService; import org.apache.dolphinscheduler.api.service.SchedulerService; import org.apache.dolphinscheduler.api.utils.CheckUtils; import org.apache.dolphinscheduler.api.utils.FileUtils; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.UserType; import org.apache.dolphinscheduler.common.graph.DAG; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils; import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils.SnowFlakeException; import org.apache.dolphinscheduler.dao.entity.DagData;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog; import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.TenantMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.service.permission.PermissionCheck; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.commons.lang.StringUtils; import java.io.BufferedOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; /** * process definition service impl */ @Service public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements ProcessDefinitionService { private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionServiceImpl.class); private static final String RELEASESTATE = "releaseState"; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
private ProjectMapper projectMapper; @Autowired private ProjectService projectService; @Autowired private UserMapper userMapper; @Autowired private ProcessDefinitionLogMapper processDefinitionLogMapper; @Autowired private ProcessDefinitionMapper processDefinitionMapper; @Autowired private ProcessInstanceService processInstanceService; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private ScheduleMapper scheduleMapper; @Autowired private ProcessService processService; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired private TaskDefinitionMapper taskDefinitionMapper; @Autowired private SchedulerService schedulerService; @Autowired private TenantMapper tenantMapper; /** * create process definition *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* @param loginUser login user * @param projectCode project code * @param name process definition name * @param description description * @param globalParams global params * @param locations locations for nodes * @param timeout timeout * @param tenantCode tenantCode * @param taskRelationJson relation json for nodes * @param taskDefinitionJson taskDefinitionJson * @return create result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> createProcessDefinition(User loginUser, long projectCode, String name, String description, String globalParams, String locations, int timeout, String tenantCode, String taskRelationJson, String taskDefinitionJson) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
ProcessDefinition definition = processDefinitionMapper.verifyByDefineName(project.getCode(), name); if (definition != null) { putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name); return result; } List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class); createTaskDefinition(result, loginUser, projectCode, taskDefinitionLogs, taskDefinitionJson); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } List<ProcessTaskRelationLog> taskRelationList = JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class); Map<String, Object> checkRelationJson = checkTaskRelationList(taskRelationList, taskRelationJson, taskDefinitionLogs); if (checkRelationJson.get(Constants.STATUS) != Status.SUCCESS) { return checkRelationJson; } int tenantId = -1; if (!Constants.DEFAULT.equals(tenantCode)) { Tenant tenant = tenantMapper.queryByTenantCode(tenantCode); if (tenant == null) { putMsg(result, Status.TENANT_NOT_EXIST); return result; } tenantId = tenant.getId(); } long processDefinitionCode; try { processDefinitionCode = SnowFlakeUtils.getInstance().nextId(); } catch (SnowFlakeException e) { putMsg(result, Status.CREATE_PROCESS_DEFINITION_ERROR);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
return result; } ProcessDefinition processDefinition = new ProcessDefinition(projectCode, name, processDefinitionCode, description, globalParams, locations, timeout, loginUser.getId(), tenantId); return createProcessDefine(loginUser, result, taskRelationList, processDefinition, taskDefinitionLogs); } private void createTaskDefinition(Map<String, Object> result, User loginUser, long projectCode, List<TaskDefinitionLog> taskDefinitionLogs, String taskDefinitionJson) { if (taskDefinitionLogs.isEmpty()) { logger.error("taskDefinitionJson invalid: {}", taskDefinitionJson); putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson); return; } for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) { if (!CheckUtils.checkTaskDefinitionParameters(taskDefinitionLog)) { logger.error("task definition {} parameter invalid", taskDefinitionLog.getName()); putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName()); return; } } if (processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs)) { putMsg(result, Status.SUCCESS); } else { putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR); } } private Map<String, Object> createProcessDefine(User loginUser,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
Map<String, Object> result, List<ProcessTaskRelationLog> taskRelationList, ProcessDefinition processDefinition, List<TaskDefinitionLog> taskDefinitionLogs) { int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, true); if (insertVersion > 0) { int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), processDefinition.getCode(), insertVersion, taskRelationList, taskDefinitionLogs); if (insertResult == Constants.EXIT_CODE_SUCCESS) { putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, processDefinition); } else { putMsg(result, Status.CREATE_PROCESS_DEFINITION_ERROR); } } else { putMsg(result, Status.CREATE_PROCESS_DEFINITION_ERROR); } return result; } private Map<String, Object> checkTaskRelationList(List<ProcessTaskRelationLog> taskRelationList, String taskRelationJson, List<TaskDefinitionLog> taskDefinitionLogs) { Map<String, Object> result = new HashMap<>(); try { if (taskRelationList == null || taskRelationList.isEmpty()) { logger.error("task relation list is null"); putMsg(result, Status.DATA_IS_NOT_VALID, taskRelationJson); return result; } List<ProcessTaskRelation> processTaskRelations = taskRelationList.stream() .map(processTaskRelationLog -> JSONUtils.parseObject(JSONUtils.toJsonString(processTaskRelationLog), ProcessTaskRelation.class)) .collect(Collectors.toList()); List<TaskNode> taskNodeList = processService.transformTask(processTaskRelations, taskDefinitionLogs);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
if (taskNodeList.size() != taskRelationList.size()) { Set<Long> postTaskCodes = taskRelationList.stream().map(ProcessTaskRelationLog::getPostTaskCode).collect(Collectors.toSet()); Set<Long> taskNodeCodes = taskNodeList.stream().map(TaskNode::getCode).collect(Collectors.toSet()); Collection<Long> codes = CollectionUtils.subtract(postTaskCodes, taskNodeCodes); if (CollectionUtils.isNotEmpty(codes)) { logger.error("the task code is not exit"); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, StringUtils.join(codes, Constants.COMMA)); return result; } } if (graphHasCycle(taskNodeList)) { logger.error("process DAG has cycle"); putMsg(result, Status.PROCESS_NODE_HAS_CYCLE); return result; } for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { if (processTaskRelationLog.getPostTaskCode() == 0) { logger.error("the post_task_code or post_task_version can't be zero"); putMsg(result, Status.CHECK_PROCESS_TASK_RELATION_ERROR); return result; } } putMsg(result, Status.SUCCESS); } catch (Exception e) { result.put(Constants.STATUS, Status.REQUEST_PARAMS_NOT_VALID_ERROR); result.put(Constants.MSG, e.getMessage()); } return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
/** * query process definition list * * @param loginUser login user * @param projectCode project code * @return definition list */ @Override public Map<String, Object> queryProcessDefinitionList(User loginUser, long projectCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } List<ProcessDefinition> resourceList = processDefinitionMapper.queryAllDefinitionList(projectCode); List<DagData> dagDataList = resourceList.stream().map(processService::genDagData).collect(Collectors.toList()); result.put(Constants.DATA_LIST, dagDataList); putMsg(result, Status.SUCCESS); return result; } /** * query process definition list paging * * @param loginUser login user * @param projectCode project code * @param searchVal search value * @param userId user id * @param pageNo page number * @param pageSize page size
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* @return process definition page */ @Override public Result queryProcessDefinitionListPaging(User loginUser, long projectCode, String searchVal, Integer userId, Integer pageNo, Integer pageSize) { Result result = new Result(); Project project = projectMapper.queryByCode(projectCode); Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectCode); Status resultStatus = (Status) checkResult.get(Constants.STATUS); if (resultStatus != Status.SUCCESS) { putMsg(result, resultStatus); return result; } Page<ProcessDefinition> page = new Page<>(pageNo, pageSize); IPage<ProcessDefinition> processDefinitionIPage = processDefinitionMapper.queryDefineListPaging( page, searchVal, userId, project.getCode(), isAdmin(loginUser)); List<ProcessDefinition> records = processDefinitionIPage.getRecords(); for (ProcessDefinition pd : records) { ProcessDefinitionLog processDefinitionLog = processDefinitionLogMapper.queryByDefinitionCodeAndVersion(pd.getCode(), pd.getVersion()); User user = userMapper.selectById(processDefinitionLog.getOperator()); pd.setModifyBy(user.getUserName()); } processDefinitionIPage.setRecords(records); PageInfo<ProcessDefinition> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotal((int) processDefinitionIPage.getTotal()); pageInfo.setTotalList(processDefinitionIPage.getRecords()); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
/** * query detail of process definition * * @param loginUser login user * @param projectCode project code * @param code process definition code * @return process definition detail */ @Override public Map<String, Object> queryProcessDefinitionByCode(User loginUser, long projectCode, long code) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code); } else { Tenant tenant = tenantMapper.queryById(processDefinition.getTenantId()); if (tenant != null) { processDefinition.setTenantCode(tenant.getTenantCode()); } DagData dagData = processService.genDagData(processDefinition); result.put(Constants.DATA_LIST, dagData); putMsg(result, Status.SUCCESS); } return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
@Override public Map<String, Object> queryProcessDefinitionByName(User loginUser, long projectCode, String name) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByDefineName(projectCode, name); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, name); } else { DagData dagData = processService.genDagData(processDefinition); result.put(Constants.DATA_LIST, dagData); putMsg(result, Status.SUCCESS); } return result; } /** * update process definition * * @param loginUser login user * @param projectCode project code * @param name process definition name * @param code process definition code * @param description description * @param globalParams global params * @param locations locations for nodes * @param timeout timeout * @param tenantCode tenantCode
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* @param taskRelationJson relation json for nodes * @param taskDefinitionJson taskDefinitionJson * @return update result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> updateProcessDefinition(User loginUser, long projectCode, String name, long code, String description, String globalParams, String locations, int timeout, String tenantCode, String taskRelationJson, String taskDefinitionJson) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class); createTaskDefinition(result, loginUser, projectCode, taskDefinitionLogs, taskDefinitionJson); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } List<ProcessTaskRelationLog> taskRelationList = JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class); Map<String, Object> checkRelationJson = checkTaskRelationList(taskRelationList, taskRelationJson, taskDefinitionLogs);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
if (checkRelationJson.get(Constants.STATUS) != Status.SUCCESS) { return checkRelationJson; } int tenantId = -1; if (!Constants.DEFAULT.equals(tenantCode)) { Tenant tenant = tenantMapper.queryByTenantCode(tenantCode); if (tenant == null) { putMsg(result, Status.TENANT_NOT_EXIST); return result; } tenantId = tenant.getId(); } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code); return result; } if (processDefinition.getReleaseState() == ReleaseState.ONLINE) { putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefinition.getName()); return result; } if (!name.equals(processDefinition.getName())) { ProcessDefinition definition = processDefinitionMapper.verifyByDefineName(project.getCode(), name); if (definition != null) { putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name); return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
} ProcessDefinition processDefinitionDeepCopy = JSONUtils.parseObject(JSONUtils.toJsonString(processDefinition), ProcessDefinition.class); processDefinition.set(projectCode, name, description, globalParams, locations, timeout, tenantId); return updateProcessDefine(loginUser, result, taskRelationList, processDefinition, processDefinitionDeepCopy, taskDefinitionLogs); } private Map<String, Object> updateProcessDefine(User loginUser, Map<String, Object> result, List<ProcessTaskRelationLog> taskRelationList, ProcessDefinition processDefinition, ProcessDefinition processDefinitionDeepCopy, List<TaskDefinitionLog> taskDefinitionLogs) { int insertVersion; if (processDefinition.equals(processDefinitionDeepCopy)) { insertVersion = processDefinitionDeepCopy.getVersion(); } else { processDefinition.setUpdateTime(new Date()); insertVersion = processService.saveProcessDefine(loginUser, processDefinition, true); } if (insertVersion > 0) { int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), processDefinition.getCode(), insertVersion, taskRelationList, taskDefinitionLogs); if (insertResult == Constants.EXIT_CODE_SUCCESS) { putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, processDefinition); } else { putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR); } } else { putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
return result; } /** * verify process definition name unique * * @param loginUser login user * @param projectCode project code * @param name name * @return true if process definition name not exists, otherwise false */ @Override public Map<String, Object> verifyProcessDefinitionName(User loginUser, long projectCode, String name) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } ProcessDefinition processDefinition = processDefinitionMapper.verifyByDefineName(project.getCode(), name.trim()); if (processDefinition == null) { putMsg(result, Status.SUCCESS); } else { putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name.trim()); } return result; } /** * delete process definition by code * * @param loginUser login user
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* @param projectCode project code * @param code process definition code * @return delete result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> deleteProcessDefinitionByCode(User loginUser, long projectCode, long code) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code); return result; } if (loginUser.getId() != processDefinition.getUserId() && loginUser.getUserType() != UserType.ADMIN_USER) { putMsg(result, Status.USER_NO_OPERATION_PERM); return result; } if (processDefinition.getReleaseState() == ReleaseState.ONLINE) { putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE, code); return result; } List<ProcessInstance> processInstances = processInstanceService.queryByProcessDefineCodeAndStatus(processDefinition.getCode(), Constants.NOT_TERMINATED_STATES);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
if (CollectionUtils.isNotEmpty(processInstances)) { putMsg(result, Status.DELETE_PROCESS_DEFINITION_BY_CODE_FAIL, processInstances.size()); return result; } List<Schedule> schedules = scheduleMapper.queryByProcessDefinitionCode(code); if (!schedules.isEmpty() && schedules.size() > 1) { logger.warn("scheduler num is {},Greater than 1", schedules.size()); putMsg(result, Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR); return result; } else if (schedules.size() == 1) { Schedule schedule = schedules.get(0); if (schedule.getReleaseState() == ReleaseState.OFFLINE) { scheduleMapper.deleteById(schedule.getId()); } else if (schedule.getReleaseState() == ReleaseState.ONLINE) { putMsg(result, Status.SCHEDULE_CRON_STATE_ONLINE, schedule.getId()); return result; } } int delete = processDefinitionMapper.deleteById(processDefinition.getId()); processTaskRelationMapper.deleteByCode(project.getCode(), processDefinition.getCode()); if (delete > 0) { putMsg(result, Status.SUCCESS); } else { putMsg(result, Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR); } return result; } /** * release process definition: online / offline
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
* * @param loginUser login user * @param projectCode project code * @param code process definition code * @param releaseState release state * @return release result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> releaseProcessDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (null == releaseState) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code); switch (releaseState) { case ONLINE: String resourceIds = processDefinition.getResourceIds(); if (StringUtils.isNotBlank(resourceIds)) { Integer[] resourceIdArray = Arrays.stream(resourceIds.split(Constants.COMMA)).map(Integer::parseInt).toArray(Integer[]::new); PermissionCheck<Integer> permissionCheck = new PermissionCheck<>(AuthorizationType.RESOURCE_FILE_ID, processService, resourceIdArray, loginUser.getId(), logger); try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
permissionCheck.checkPermission(); } catch (Exception e) { logger.error(e.getMessage(), e); putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION, RELEASESTATE); return result; } } processDefinition.setReleaseState(releaseState); processDefinitionMapper.updateById(processDefinition); break; case OFFLINE: processDefinition.setReleaseState(releaseState); processDefinitionMapper.updateById(processDefinition); List<Schedule> scheduleList = scheduleMapper.selectAllByProcessDefineArray( new long[]{processDefinition.getCode()} ); for (Schedule schedule : scheduleList) { logger.info("set schedule offline, project id: {}, schedule id: {}, process definition code: {}", project.getId(), schedule.getId(), code); schedule.setReleaseState(ReleaseState.OFFLINE); scheduleMapper.updateById(schedule); schedulerService.deleteSchedule(project.getId(), schedule.getId()); } break; default: putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } putMsg(result, Status.SUCCESS); return result;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
} /** * batch export process definition by codes */ @Override public void batchExportProcessDefinitionByCodes(User loginUser, long projectCode, String codes, HttpServletResponse response) { if (StringUtils.isEmpty(codes)) { return; } Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return; } Set<Long> defineCodeSet = Lists.newArrayList(codes.split(Constants.COMMA)).stream().map(Long::parseLong).collect(Collectors.toSet()); List<ProcessDefinition> processDefinitionList = processDefinitionMapper.queryByCodes(defineCodeSet); List<DagDataSchedule> dagDataSchedules = processDefinitionList.stream().map(this::exportProcessDagData).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(dagDataSchedules)) { downloadProcessDefinitionFile(response, dagDataSchedules); } } /** * download the process definition file */ private void downloadProcessDefinitionFile(HttpServletResponse response, List<DagDataSchedule> dagDataSchedules) { response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE); BufferedOutputStream buff = null; ServletOutputStream out = null; try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,286
[Bug] [API] Delete processDefinitionVersion bug
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When deleting the workflow version, the workflow relationship of the corresponding version should be deleted. Only this version of the workflow will now be deleted. ### What you expected to happen When deleting the workflow version, the workflow relationship of the corresponding version will be deleted. ### How to reproduce Operate deleteProcessDefinitionVersion ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6286
https://github.com/apache/dolphinscheduler/pull/6287
51e27bb4b64e8270d135dad7fd277124a43761c8
8980b7027a30f75445882280e5872b49985a5188
"2021-09-21T07:16:14Z"
java
"2021-09-21T14:35:50Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
out = response.getOutputStream(); buff = new BufferedOutputStream(out); buff.write(JSONUtils.toJsonString(dagDataSchedules).getBytes(StandardCharsets.UTF_8)); buff.flush(); buff.close(); } catch (IOException e) { logger.warn("export process fail", e); } finally { if (null != buff) { try { buff.close(); } catch (Exception e) { logger.warn("export process buffer not close", e); } } if (null != out) { try { out.close(); } catch (Exception e) { logger.warn("export process output stream not close", e); } } } } /** * get export process dag data * * @param processDefinition process definition * @return DagDataSchedule */