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
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements ProcessTaskRelationService { @Autowired private ProjectMapper projectMapper; @Autowired private ProjectService projectService; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
private TaskDefinitionMapper taskDefinitionMapper; @Autowired private ProcessDefinitionMapper processDefinitionMapper; @Autowired private ProcessService processService; /** * create process task relation * * @param loginUser login user * @param projectCode project code * @param processDefinitionCode processDefinitionCode * @param preTaskCode preTaskCode * @param postTaskCode postTaskCode * @return create result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> createProcessTaskRelation(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { 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(processDefinitionCode); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); return result; } if (processDefinition.getProjectCode() != projectCode) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
putMsg(result, Status.PROJECT_PROCESS_NOT_MATCH); return result; } updateProcessDefiniteVersion(loginUser, result, processDefinition); List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); List<ProcessTaskRelation> processTaskRelations = Lists.newArrayList(processTaskRelationList); if (!processTaskRelations.isEmpty()) { Map<Long, ProcessTaskRelation> preTaskCodeMap = processTaskRelations.stream().filter(r -> r.getPostTaskCode() == postTaskCode) .collect(Collectors.toMap(ProcessTaskRelation::getPreTaskCode, processTaskRelation -> processTaskRelation)); if (!preTaskCodeMap.isEmpty()) { if (preTaskCodeMap.containsKey(preTaskCode) || (!preTaskCodeMap.containsKey(0L) && preTaskCode == 0L)) { putMsg(result, Status.PROCESS_TASK_RELATION_EXIST, processDefinitionCode); return result; } if (preTaskCodeMap.containsKey(0L) && preTaskCode != 0L) { processTaskRelations.remove(preTaskCodeMap.get(0L)); } } } TaskDefinition postTaskDefinition = taskDefinitionMapper.queryByCode(postTaskCode); ProcessTaskRelation processTaskRelation = setRelation(processDefinition, postTaskDefinition); if (preTaskCode != 0L) { TaskDefinition preTaskDefinition = taskDefinitionMapper.queryByCode(preTaskCode); List<ProcessTaskRelation> upstreamTaskRelationList = processTaskRelations.stream().filter(r -> r.getPostTaskCode() == preTaskCode).collect(Collectors.toList()); if (upstreamTaskRelationList.isEmpty()) { ProcessTaskRelation preProcessTaskRelation = setRelation(processDefinition, preTaskDefinition); preProcessTaskRelation.setPreTaskCode(0L); preProcessTaskRelation.setPreTaskVersion(0);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
processTaskRelations.add(preProcessTaskRelation); } processTaskRelation.setPreTaskCode(preTaskDefinition.getCode()); processTaskRelation.setPreTaskVersion(preTaskDefinition.getVersion()); } else { processTaskRelation.setPreTaskCode(0L); processTaskRelation.setPreTaskVersion(0); } processTaskRelations.add(processTaskRelation); updateRelation(loginUser, result, processDefinition, processTaskRelations); return result; } private ProcessTaskRelation setRelation(ProcessDefinition processDefinition, TaskDefinition taskDefinition) { Date now = new Date(); ProcessTaskRelation processTaskRelation = new ProcessTaskRelation(); processTaskRelation.setProjectCode(processDefinition.getProjectCode()); processTaskRelation.setProcessDefinitionCode(processDefinition.getCode()); processTaskRelation.setProcessDefinitionVersion(processDefinition.getVersion()); processTaskRelation.setPostTaskCode(taskDefinition.getCode()); processTaskRelation.setPostTaskVersion(taskDefinition.getVersion()); processTaskRelation.setConditionType(ConditionType.NONE); processTaskRelation.setConditionParams("{}"); processTaskRelation.setCreateTime(now); processTaskRelation.setUpdateTime(now); return processTaskRelation; } private void updateProcessDefiniteVersion(User loginUser, Map<String, Object> result, ProcessDefinition processDefinition) { int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE); if (insertVersion <= 0) { putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } processDefinition.setVersion(insertVersion); } /** * delete process task relation * * @param loginUser login user * @param projectCode project code * @param processDefinitionCode process definition code * @param taskCode the post task code * @return delete result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> deleteTaskProcessRelation(User loginUser, long projectCode, long processDefinitionCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (taskCode == 0) { putMsg(result, Status.DELETE_TASK_PROCESS_RELATION_ERROR); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); return result;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
} TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (null == taskDefinition) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); return result; } List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); if (CollectionUtils.isEmpty(processTaskRelationList)) { putMsg(result, Status.DATA_IS_NULL, "processTaskRelationList"); return result; } List<Long> downstreamList = Lists.newArrayList(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { if (processTaskRelation.getPreTaskCode() == taskCode) { downstreamList.add(processTaskRelation.getPostTaskCode()); } if (processTaskRelation.getPostTaskCode() == taskCode) { processTaskRelationList.remove(processTaskRelation); } } if (CollectionUtils.isNotEmpty(downstreamList)) { putMsg(result, Status.TASK_HAS_DOWNSTREAM, org.apache.commons.lang.StringUtils.join(downstreamList, ",")); return result; } updateProcessDefiniteVersion(loginUser, result, processDefinition); updateRelation(loginUser, result, processDefinition, processTaskRelationList); if (TASK_TYPE_CONDITIONS.equals(taskDefinition.getTaskType()) || TASK_TYPE_DEPENDENT.equals(taskDefinition.getTaskType()) || TASK_TYPE_SUB_PROCESS.equals(taskDefinition.getTaskType())) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
int deleteTaskDefinition = taskDefinitionMapper.deleteByCode(taskCode); if (0 == deleteTaskDefinition) { putMsg(result, Status.DELETE_TASK_DEFINE_BY_CODE_ERROR); throw new ServiceException(Status.DELETE_TASK_DEFINE_BY_CODE_ERROR); } } putMsg(result, Status.SUCCESS); return result; } private void updateRelation(User loginUser, Map<String, Object> result, ProcessDefinition processDefinition, List<ProcessTaskRelation> processTaskRelationList) { List<ProcessTaskRelationLog> relationLogs = processTaskRelationList.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList()); int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), processDefinition.getCode(), processDefinition.getVersion(), relationLogs, Lists.newArrayList(), Boolean.TRUE); if (insertResult == Constants.EXIT_CODE_SUCCESS) { putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, processDefinition); } else { putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } } /** * delete task upstream relation * * @param loginUser login user * @param projectCode project code * @param preTaskCodes the pre task codes, sep ',' * @param taskCode the post task code * @return delete result code
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
*/ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> deleteUpstreamRelation(User loginUser, long projectCode, String preTaskCodes, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (StringUtils.isEmpty(preTaskCodes)) { putMsg(result, Status.DATA_IS_NULL, "preTaskCodes"); return result; } List<ProcessTaskRelation> upstreamList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (CollectionUtils.isEmpty(upstreamList)) { putMsg(result, Status.DATA_IS_NULL, "taskCode"); return result; } List<Long> preTaskCodeList = Lists.newArrayList(preTaskCodes.split(Constants.COMMA)).stream().map(Long::parseLong).collect(Collectors.toList()); if (preTaskCodeList.contains(0L)) { putMsg(result, Status.DATA_IS_NULL, "preTaskCodes"); return result; } List<Long> currentUpstreamList = upstreamList.stream().map(ProcessTaskRelation::getPreTaskCode).collect(Collectors.toList()); if (currentUpstreamList.contains(0L)) { putMsg(result, Status.DATA_IS_NOT_VALID, "currentUpstreamList"); return result; } List<Long> tmpCurrent = Lists.newArrayList(currentUpstreamList);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
tmpCurrent.removeAll(preTaskCodeList); preTaskCodeList.removeAll(currentUpstreamList); if (!preTaskCodeList.isEmpty()) { putMsg(result, Status.DATA_IS_NOT_VALID, StringUtils.join(preTaskCodeList, Constants.COMMA)); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(upstreamList.get(0).getProcessDefinitionCode()); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, upstreamList.get(0).getProcessDefinitionCode()); return result; } List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); List<ProcessTaskRelation> processTaskRelationWaitRemove = Lists.newArrayList(); for (ProcessTaskRelation processTaskRelation : processTaskRelationList) { if (currentUpstreamList.size() > 1) { if (currentUpstreamList.contains(processTaskRelation.getPreTaskCode())) { currentUpstreamList.remove(processTaskRelation.getPreTaskCode()); processTaskRelationWaitRemove.add(processTaskRelation); } } else { if (processTaskRelation.getPostTaskCode() == taskCode && (currentUpstreamList.isEmpty() || tmpCurrent.isEmpty())) { processTaskRelation.setPreTaskVersion(0); processTaskRelation.setPreTaskCode(0L); } } } processTaskRelationList.removeAll(processTaskRelationWaitRemove); updateProcessDefiniteVersion(loginUser, result, processDefinition); updateRelation(loginUser, result, processDefinition, processTaskRelationList);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
return result; } /** * delete task downstream relation * * @param loginUser login user * @param projectCode project code * @param postTaskCodes the post task codes, sep ',' * @param taskCode the pre task code * @return delete result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> deleteDownstreamRelation(User loginUser, long projectCode, String postTaskCodes, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (StringUtils.isEmpty(postTaskCodes)) { putMsg(result, Status.DATA_IS_NULL, "postTaskCodes"); return result; } List<ProcessTaskRelation> downstreamList = processTaskRelationMapper.queryDownstreamByCode(projectCode, taskCode); if (CollectionUtils.isEmpty(downstreamList)) { putMsg(result, Status.DATA_IS_NULL, "taskCode"); return result; } List<Long> postTaskCodeList = Lists.newArrayList(postTaskCodes.split(Constants.COMMA)).stream().map(Long::parseLong).collect(Collectors.toList());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
if (postTaskCodeList.contains(0L)) { putMsg(result, Status.DATA_IS_NULL, "postTaskCodes"); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(downstreamList.get(0).getProcessDefinitionCode()); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, downstreamList.get(0).getProcessDefinitionCode()); return result; } List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); processTaskRelationList.removeIf(processTaskRelation -> postTaskCodeList.contains(processTaskRelation.getPostTaskCode()) && processTaskRelation.getPreTaskCode() == taskCode); updateProcessDefiniteVersion(loginUser, result, processDefinition); updateRelation(loginUser, result, processDefinition, processTaskRelationList); return result; } /** * query task upstream relation * * @param loginUser login user * @param projectCode project code * @param taskCode current task code (post task code) * @return the upstream task definitions */ @Override public Map<String, Object> queryUpstreamRelation(User loginUser, long projectCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
return result; } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); List<TaskDefinitionLog> taskDefinitionLogList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(processTaskRelationList)) { Set<TaskDefinition> taskDefinitions = processTaskRelationList .stream() .map(processTaskRelation -> { TaskDefinition taskDefinition = buildTaskDefinition(); taskDefinition.setProjectCode(processTaskRelation.getProjectCode()); taskDefinition.setCode(processTaskRelation.getPreTaskCode()); taskDefinition.setVersion(processTaskRelation.getPreTaskVersion()); return taskDefinition; }) .collect(Collectors.toSet()); taskDefinitionLogList = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitions); } result.put(Constants.DATA_LIST, taskDefinitionLogList); putMsg(result, Status.SUCCESS); return result; } /** * query task downstream relation * * @param loginUser login user * @param projectCode project code * @param taskCode pre task code * @return the downstream task definitions */ @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
public Map<String, Object> queryDownstreamRelation(User loginUser, long projectCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryDownstreamByCode(projectCode, taskCode); List<TaskDefinitionLog> taskDefinitionLogList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(processTaskRelationList)) { Set<TaskDefinition> taskDefinitions = processTaskRelationList .stream() .map(processTaskRelation -> { TaskDefinition taskDefinition = buildTaskDefinition(); taskDefinition.setProjectCode(processTaskRelation.getProjectCode()); taskDefinition.setCode(processTaskRelation.getPostTaskCode()); taskDefinition.setVersion(processTaskRelation.getPostTaskVersion()); return taskDefinition; }) .collect(Collectors.toSet()); taskDefinitionLogList = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitions); } result.put(Constants.DATA_LIST, taskDefinitionLogList); putMsg(result, Status.SUCCESS); return result; } /** * delete edge * * @param loginUser login user
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
* @param projectCode project code * @param processDefinitionCode process definition code * @param preTaskCode pre task code * @param postTaskCode post task code * @return delete result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> deleteEdge(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { 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(processDefinitionCode); if (processDefinition == null) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); return result; } List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); if (CollectionUtils.isEmpty(processTaskRelationList)) { putMsg(result, Status.DATA_IS_NULL, "processTaskRelationList"); return result; } Map<Long, List<ProcessTaskRelation>> taskRelationMap = new HashMap<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelationList) { taskRelationMap.compute(processTaskRelation.getPostTaskCode(), (k, v) -> { if (v == null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
v = new ArrayList<>(); } v.add(processTaskRelation); return v; }); } if (!taskRelationMap.containsKey(postTaskCode)) { putMsg(result, Status.DATA_IS_NULL, "postTaskCode"); return result; } if (taskRelationMap.get(postTaskCode).size() > 1) { for (ProcessTaskRelation processTaskRelation : taskRelationMap.get(postTaskCode)) { if (processTaskRelation.getPreTaskCode() == preTaskCode) { int delete = processTaskRelationMapper.deleteById(processTaskRelation.getId()); if (delete == 0) { putMsg(result, Status.DELETE_EDGE_ERROR); throw new ServiceException(Status.DELETE_EDGE_ERROR); } processTaskRelationList.remove(processTaskRelation); } } } else { ProcessTaskRelation processTaskRelation = taskRelationMap.get(postTaskCode).get(0); processTaskRelationList.remove(processTaskRelation); processTaskRelation.setPreTaskVersion(0); processTaskRelation.setPreTaskCode(0L); processTaskRelationList.add(processTaskRelation); } updateProcessDefiniteVersion(loginUser, result, processDefinition); updateRelation(loginUser, result, processDefinition, processTaskRelationList);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
return result; } /** * build task definition * * @return task definition */ private TaskDefinition buildTaskDefinition() { return new TaskDefinition() { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TaskDefinition)) { return false; } TaskDefinition that = (TaskDefinition) o; return getCode() == that.getCode() && getVersion() == that.getVersion() && getProjectCode() == that.getProjectCode(); } @Override public int hashCode() { return Objects.hash(getCode(), getVersion(), getProjectCode()); } }; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
* 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 * limitations under the License. */ package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.dto.ScheduleParam; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ServiceException; import org.apache.dolphinscheduler.api.service.ExecutorService; import org.apache.dolphinscheduler.api.service.MonitorService; import org.apache.dolphinscheduler.api.service.ProjectService; import org.apache.dolphinscheduler.api.service.SchedulerService; 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.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.UserType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.model.Server; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
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.service.process.ProcessService; import org.apache.dolphinscheduler.service.quartz.ProcessScheduleJob; import org.apache.dolphinscheduler.service.quartz.QuartzExecutor; import org.apache.dolphinscheduler.service.quartz.impl.QuartzExecutorImpl; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils; import org.apache.commons.lang.StringUtils; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.quartz.CronExpression; import org.quartz.JobKey; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; /** * scheduler service impl */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerService { private static final Logger logger = LoggerFactory.getLogger(SchedulerServiceImpl.class); @Autowired private ProjectService projectService; @Autowired private ExecutorService executorService; @Autowired private MonitorService monitorService; @Autowired private ProcessService processService; @Autowired private ScheduleMapper scheduleMapper; @Autowired private ProjectMapper projectMapper; @Autowired private ProcessDefinitionMapper processDefinitionMapper; @Autowired private Scheduler scheduler; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private QuartzExecutor quartzExecutor; /** * save schedule *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
* @param loginUser login user * @param projectCode project name * @param processDefineCode process definition code * @param schedule scheduler * @param warningType warning type * @param warningGroupId warning group id * @param failureStrategy failure strategy * @param processInstancePriority process instance priority * @param workerGroup worker group * @param environmentCode environment code * @return create result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> insertSchedule(User loginUser, long projectCode, long processDefineCode, String schedule, WarningType warningType, int warningGroupId, FailureStrategy failureStrategy, Priority processInstancePriority, String workerGroup, Long environmentCode) { Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByCode(projectCode); boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) { return result;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
} ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode); result = executorService.checkProcessDefinitionValid(projectCode,processDefinition, processDefineCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } Schedule scheduleObj = new Schedule(); Date now = new Date(); scheduleObj.setProjectName(project.getName()); scheduleObj.setProcessDefinitionCode(processDefineCode); scheduleObj.setProcessDefinitionName(processDefinition.getName()); ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class); if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) { logger.warn("The start time must not be the same as the end"); putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME); return result; } if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) { logger.warn("The start time must smaller than end time"); putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR); return result; } scheduleObj.setStartTime(scheduleParam.getStartTime()); scheduleObj.setEndTime(scheduleParam.getEndTime()); if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) { logger.error("{} verify failure", scheduleParam.getCrontab()); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, scheduleParam.getCrontab()); return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
scheduleObj.setCrontab(scheduleParam.getCrontab()); scheduleObj.setTimezoneId(scheduleParam.getTimezoneId()); scheduleObj.setWarningType(warningType); scheduleObj.setWarningGroupId(warningGroupId); scheduleObj.setFailureStrategy(failureStrategy); scheduleObj.setCreateTime(now); scheduleObj.setUpdateTime(now); scheduleObj.setUserId(loginUser.getId()); scheduleObj.setUserName(loginUser.getUserName()); scheduleObj.setReleaseState(ReleaseState.OFFLINE); scheduleObj.setProcessInstancePriority(processInstancePriority); scheduleObj.setWorkerGroup(workerGroup); scheduleObj.setEnvironmentCode(environmentCode); scheduleMapper.insert(scheduleObj); /** * updateProcessInstance receivers and cc by process definition id */ processDefinition.setWarningGroupId(warningGroupId); processDefinitionMapper.updateById(processDefinition); result.put(Constants.DATA_LIST, scheduleMapper.selectById(scheduleObj.getId())); putMsg(result, Status.SUCCESS); result.put("scheduleId", scheduleObj.getId()); return result; } /** * updateProcessInstance schedule * * @param loginUser login user * @param projectCode project code
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
* @param id scheduler id * @param scheduleExpression scheduler * @param warningType warning type * @param warningGroupId warning group id * @param failureStrategy failure strategy * @param workerGroup worker group * @param environmentCode environment code * @param processInstancePriority process instance priority * @return update result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> updateSchedule(User loginUser, long projectCode, Integer id, String scheduleExpression, WarningType warningType, int warningGroupId, FailureStrategy failureStrategy, Priority processInstancePriority, String workerGroup, Long environmentCode) { Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByCode(projectCode); boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) { return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
Schedule schedule = scheduleMapper.selectById(id); if (schedule == null) { putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, id); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(schedule.getProcessDefinitionCode()); if (processDefinition == null || projectCode != processDefinition.getProjectCode()) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, schedule.getProcessDefinitionCode()); return result; } updateSchedule(result, schedule, processDefinition, scheduleExpression, warningType, warningGroupId, failureStrategy, processInstancePriority, workerGroup, environmentCode); return result; } /** * set schedule online or offline * * @param loginUser login user * @param projectCode project code * @param id scheduler id * @param scheduleStatus schedule status * @return publish result code */ @Override @Transactional(rollbackFor = RuntimeException.class) public Map<String, Object> setScheduleState(User loginUser, long projectCode, Integer id, ReleaseState scheduleStatus) { Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByCode(projectCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) { return result; } Schedule scheduleObj = scheduleMapper.selectById(id); if (scheduleObj == null) { putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, id); return result; } if (scheduleObj.getReleaseState() == scheduleStatus) { logger.info("schedule release is already {},needn't to change schedule id: {} from {} to {}", scheduleObj.getReleaseState(), scheduleObj.getId(), scheduleObj.getReleaseState(), scheduleStatus); putMsg(result, Status.SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE, scheduleStatus); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(scheduleObj.getProcessDefinitionCode()); if (processDefinition == null || projectCode != processDefinition.getProjectCode()) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, scheduleObj.getProcessDefinitionCode()); return result; } List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, scheduleObj.getProcessDefinitionCode()); if (processTaskRelations.isEmpty()) { putMsg(result, Status.PROCESS_DAG_IS_EMPTY); return result; } if (scheduleStatus == ReleaseState.ONLINE) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
if (processDefinition.getReleaseState() != ReleaseState.ONLINE) { logger.info("not release process definition id: {} , name : {}", processDefinition.getId(), processDefinition.getName()); putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, processDefinition.getName()); return result; } List<Long> subProcessDefineCodes = new ArrayList<>(); processService.recurseFindSubProcess(processDefinition.getCode(), subProcessDefineCodes); if (!subProcessDefineCodes.isEmpty()) { List<ProcessDefinition> subProcessDefinitionList = processDefinitionMapper.queryByCodes(subProcessDefineCodes); if (subProcessDefinitionList != null && !subProcessDefinitionList.isEmpty()) { for (ProcessDefinition subProcessDefinition : subProcessDefinitionList) { /** * if there is no online process, exit directly */ if (subProcessDefinition.getReleaseState() != ReleaseState.ONLINE) { logger.info("not release process definition id: {} , name : {}", subProcessDefinition.getId(), subProcessDefinition.getName()); putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, subProcessDefinition.getId()); return result; } } } } } List<Server> masterServers = monitorService.getServerListFromRegistry(true); if (masterServers.isEmpty()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
putMsg(result, Status.MASTER_NOT_EXISTS); return result; } scheduleObj.setReleaseState(scheduleStatus); scheduleMapper.updateById(scheduleObj); try { switch (scheduleStatus) { case ONLINE: logger.info("Call master client set schedule online, project id: {}, flow id: {},host: {}", project.getId(), processDefinition.getId(), masterServers); setSchedule(project.getId(), scheduleObj); break; case OFFLINE: logger.info("Call master client set schedule offline, project id: {}, flow id: {},host: {}", project.getId(), processDefinition.getId(), masterServers); deleteSchedule(project.getId(), id); break; default: putMsg(result, Status.SCHEDULE_STATUS_UNKNOWN, scheduleStatus.toString()); return result; } } catch (Exception e) { result.put(Constants.MSG, scheduleStatus == ReleaseState.ONLINE ? "set online failure" : "set offline failure"); throw new ServiceException(result.get(Constants.MSG).toString(), e); } putMsg(result, Status.SUCCESS); return result; } /** * query schedule *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
* @param loginUser login user * @param projectCode project code * @param processDefineCode process definition code * @param pageNo page number * @param pageSize page size * @param searchVal search value * @return schedule list page */ @Override public Result querySchedule(User loginUser, long projectCode, long processDefineCode, String searchVal, Integer pageNo, Integer pageSize) { Result result = new Result(); Project project = projectMapper.queryByCode(projectCode); boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) { return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode); if (processDefinition == null || projectCode != processDefinition.getProjectCode()) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefineCode); return result; } Page<Schedule> page = new Page<>(pageNo, pageSize); IPage<Schedule> scheduleIPage = scheduleMapper.queryByProcessDefineCodePaging(page, processDefineCode, searchVal); PageInfo<Schedule> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotal((int) scheduleIPage.getTotal()); pageInfo.setTotalList(scheduleIPage.getRecords()); result.setData(pageInfo);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
putMsg(result, Status.SUCCESS); return result; } /** * query schedule list * * @param loginUser login user * @param projectCode project code * @return schedule list */ @Override public Map<String, Object> queryScheduleList(User loginUser, long projectCode) { Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByCode(projectCode); boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) { return result; } List<Schedule> schedules = scheduleMapper.querySchedulerListByProjectName(project.getName()); result.put(Constants.DATA_LIST, schedules); putMsg(result, Status.SUCCESS); return result; } public void setSchedule(int projectId, Schedule schedule) { logger.info("set schedule, project id: {}, scheduleId: {}", projectId, schedule.getId()); quartzExecutor.addJob(ProcessScheduleJob.class, projectId, schedule); } /** * delete schedule
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
* * @param projectId project id * @param scheduleId schedule id * @throws RuntimeException runtime exception */ @Override public void deleteSchedule(int projectId, int scheduleId) { logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId); String jobName = quartzExecutor.buildJobName(scheduleId); String jobGroupName = quartzExecutor.buildJobGroupName(projectId); JobKey jobKey = new JobKey(jobName, jobGroupName); try { if (scheduler.checkExists(jobKey)) { logger.info("Try to delete job: {}, group name: {},", jobName, jobGroupName); scheduler.deleteJob(jobKey); } } catch (SchedulerException e) { logger.error("Failed to delete job: {}", jobKey); throw new ServiceException("Failed to delete job: " + jobKey); } } /** * check valid * * @param result result * @param bool bool * @param status status * @return check result code */ private boolean checkValid(Map<String, Object> result, boolean bool, Status status) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
if (bool) { putMsg(result, status); return true; } return false; } /** * delete schedule by id * * @param loginUser login user * @param projectCode project code * @param scheduleId scheule id * @return delete result code */ @Override public Map<String, Object> deleteScheduleById(User loginUser, long projectCode, Integer scheduleId) { Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByCode(projectCode); Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectCode); Status resultEnum = (Status) checkResult.get(Constants.STATUS); if (resultEnum != Status.SUCCESS) { return checkResult; } Schedule schedule = scheduleMapper.selectById(scheduleId); if (schedule == null) { putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, scheduleId); return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
if (loginUser.getId() != schedule.getUserId() && loginUser.getUserType() != UserType.ADMIN_USER) { putMsg(result, Status.USER_NO_OPERATION_PERM); return result; } if (schedule.getReleaseState() == ReleaseState.ONLINE) { putMsg(result, Status.SCHEDULE_CRON_STATE_ONLINE, schedule.getId()); return result; } int delete = scheduleMapper.deleteById(scheduleId); if (delete > 0) { putMsg(result, Status.SUCCESS); } else { putMsg(result, Status.DELETE_SCHEDULE_CRON_BY_ID_ERROR); } return result; } /** * preview schedule * * @param loginUser login user * @param schedule schedule expression * @return the next five fire time */ @Override public Map<String, Object> previewSchedule(User loginUser, String schedule) { Map<String, Object> result = new HashMap<>(); CronExpression cronExpression; ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
Date now = new Date(); Date startTime = now.after(scheduleParam.getStartTime()) ? now : scheduleParam.getStartTime(); Date endTime = scheduleParam.getEndTime(); try { cronExpression = CronUtils.parse2CronExpression(scheduleParam.getCrontab()); } catch (ParseException e) { logger.error(e.getMessage(), e); putMsg(result, Status.PARSE_TO_CRON_EXPRESSION_ERROR); return result; } List<Date> selfFireDateList = CronUtils.getSelfFireDateList(startTime, endTime, cronExpression, Constants.PREVIEW_SCHEDULE_EXECUTE_COUNT); List<String> previewDateList = new ArrayList<>(); selfFireDateList.forEach(date -> previewDateList.add(DateUtils.dateToString(date, scheduleParam.getTimezoneId()))); result.put(Constants.DATA_LIST, previewDateList); putMsg(result, Status.SUCCESS); return result; } /** * update process definition schedule * * @param loginUser login user * @param projectCode project code * @param processDefinitionCode process definition code * @param scheduleExpression scheduleExpression * @param warningType warning type * @param warningGroupId warning group id * @param failureStrategy failure strategy * @param workerGroup worker group * @param processInstancePriority process instance priority * @return update result code
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
*/ @Override public Map<String, Object> updateScheduleByProcessDefinitionCode(User loginUser, long projectCode, long processDefinitionCode, String scheduleExpression, WarningType warningType, int warningGroupId, FailureStrategy failureStrategy, Priority processInstancePriority, String workerGroup, long environmentCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } Schedule schedule = scheduleMapper.queryByProcessDefinitionCode(processDefinitionCode); if (schedule == null) { putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, processDefinitionCode); return result; } ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode); if (processDefinition == null || projectCode != processDefinition.getProjectCode()) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); return result; } updateSchedule(result, schedule, processDefinition, scheduleExpression, warningType, warningGroupId, failureStrategy, processInstancePriority, workerGroup, environmentCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
return result; } private void updateSchedule(Map<String, Object> result, Schedule schedule, ProcessDefinition processDefinition, String scheduleExpression, WarningType warningType, int warningGroupId, FailureStrategy failureStrategy, Priority processInstancePriority, String workerGroup, long environmentCode) { if (checkValid(result, schedule.getReleaseState() == ReleaseState.ONLINE, Status.SCHEDULE_CRON_ONLINE_FORBID_UPDATE)) { return; } Date now = new Date(); if (!StringUtils.isEmpty(scheduleExpression)) { ScheduleParam scheduleParam = JSONUtils.parseObject(scheduleExpression, ScheduleParam.class); if (scheduleParam == null) { putMsg(result, Status.PARSE_TO_CRON_EXPRESSION_ERROR); return; } if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) { logger.warn("The start time must not be the same as the end"); putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME); return; } if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) { logger.warn("The start time must smaller than end time");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR); return; } schedule.setStartTime(scheduleParam.getStartTime()); schedule.setEndTime(scheduleParam.getEndTime()); if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) { putMsg(result, Status.SCHEDULE_CRON_CHECK_FAILED, scheduleParam.getCrontab()); return; } schedule.setCrontab(scheduleParam.getCrontab()); schedule.setTimezoneId(scheduleParam.getTimezoneId()); } if (warningType != null) { schedule.setWarningType(warningType); } schedule.setWarningGroupId(warningGroupId); if (failureStrategy != null) { schedule.setFailureStrategy(failureStrategy); } schedule.setWorkerGroup(workerGroup); schedule.setEnvironmentCode(environmentCode); schedule.setUpdateTime(now); schedule.setProcessInstancePriority(processInstancePriority); scheduleMapper.updateById(schedule); processDefinition.setWarningGroupId(warningGroupId); processDefinitionMapper.updateById(processDefinition); putMsg(result, Status.SUCCESS); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
* 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 * limitations under the License. */ package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ServiceException; import org.apache.dolphinscheduler.api.service.ProjectService; import org.apache.dolphinscheduler.api.service.TaskDefinitionService; 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.ConditionType; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; 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.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; import org.apache.dolphinscheduler.dao.entity.TaskMainInfo; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper; import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; import org.apache.dolphinscheduler.service.permission.PermissionCheck; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.task.TaskPluginManager; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; /** * task definition service impl */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDefinitionService { private static final Logger logger = LoggerFactory.getLogger(TaskDefinitionServiceImpl.class); private static final String RELEASESTATE = "releaseState"; @Autowired private ProjectMapper projectMapper; @Autowired private ProjectService projectService; @Autowired private TaskDefinitionMapper taskDefinitionMapper; @Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private ProcessDefinitionMapper processDefinitionMapper; @Autowired private ProcessService processService; @Autowired private TaskPluginManager taskPluginManager; /** * create task definition * * @param loginUser login user * @param projectCode project code * @param taskDefinitionJson task definition json */ @Transactional(rollbackFor = RuntimeException.class) @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
public Map<String, Object> createTaskDefinition(User loginUser, long projectCode, 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); if (taskDefinitionLogs.isEmpty()) { logger.error("taskDefinitionJson invalid: {}", taskDefinitionJson); putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson); return result; } for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) { if (!taskPluginManager.checkTaskParameters(ParametersNode.builder() .taskType(taskDefinitionLog.getTaskType()) .taskParams(taskDefinitionLog.getTaskParams()) .dependence(taskDefinitionLog.getDependence()) .build())) { logger.error("task definition {} parameter invalid", taskDefinitionLog.getName()); putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName()); return result; } } int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs, Boolean.TRUE); if (saveTaskResult == Constants.DEFINITION_FAILURE) { putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} Map<String, Object> resData = new HashMap<>(); resData.put("total", taskDefinitionLogs.size()); resData.put("code", StringUtils.join(taskDefinitionLogs.stream().map(TaskDefinition::getCode).collect(Collectors.toList()), ",")); putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, resData); return result; } /** * create single task definition that binds the workflow * * @param loginUser login user * @param projectCode project code * @param processDefinitionCode process definition code * @param taskDefinitionJsonObj task definition json object * @param upstreamCodes upstream task codes, sep comma * @return create result code */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> createTaskBindsWorkFlow(User loginUser, long projectCode, long processDefinitionCode, String taskDefinitionJsonObj, String upstreamCodes) { 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
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode); if (processDefinition == null || projectCode != processDefinition.getProjectCode()) { putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); return result; } if (processDefinition.getReleaseState() == ReleaseState.ONLINE) { putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE, processDefinitionCode); return result; } TaskDefinitionLog taskDefinition = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class); if (taskDefinition == null) { logger.error("taskDefinitionJsonObj is not valid json"); putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj); return result; } if (!taskPluginManager.checkTaskParameters(ParametersNode.builder() .taskType(taskDefinition.getTaskType()) .taskParams(taskDefinition.getTaskParams()) .dependence(taskDefinition.getDependence()) .build())) { logger.error("task definition {} parameter invalid", taskDefinition.getName()); putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinition.getName()); return result; } long taskCode = taskDefinition.getCode(); if (taskCode == 0) { try { taskCode = CodeGenerateUtils.getInstance().genCode(); taskDefinition.setCode(taskCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} catch (CodeGenerateException e) { logger.error("Task code get error, ", e); putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS, taskDefinitionJsonObj); return result; } } List<ProcessTaskRelationLog> processTaskRelationLogList = Lists.newArrayList(); if (StringUtils.isNotBlank(upstreamCodes)) { Set<Long> upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong).collect(Collectors.toSet()); List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes); Set<Long> queryUpStreamTaskCodes = upstreamTaskDefinitionList.stream().map(TaskDefinition::getCode).collect(Collectors.toSet()); Set<Long> diffCode = upstreamTaskCodes.stream().filter(code -> !queryUpStreamTaskCodes.contains(code)).collect(Collectors.toSet()); if (!diffCode.isEmpty()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, StringUtils.join(diffCode, Constants.COMMA)); return result; } for (TaskDefinition upstreamTask : upstreamTaskDefinitionList) { ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog(); processTaskRelationLog.setPreTaskCode(upstreamTask.getCode()); processTaskRelationLog.setPreTaskVersion(upstreamTask.getVersion()); processTaskRelationLog.setPostTaskCode(taskCode); processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST); processTaskRelationLog.setConditionType(ConditionType.NONE); processTaskRelationLog.setConditionParams("{}"); processTaskRelationLogList.add(processTaskRelationLog); } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); if (!processTaskRelationList.isEmpty()) { processTaskRelationLogList.addAll(processTaskRelationList.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList()));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} } else { ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog(); processTaskRelationLog.setPreTaskCode(0); processTaskRelationLog.setPreTaskVersion(0); processTaskRelationLog.setPostTaskCode(taskCode); processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST); processTaskRelationLog.setConditionType(ConditionType.NONE); processTaskRelationLog.setConditionParams("{}"); processTaskRelationLogList.add(processTaskRelationLog); } int insertResult = processService.saveTaskRelation(loginUser, projectCode, processDefinition.getCode(), processDefinition.getVersion(), processTaskRelationLogList, Lists.newArrayList(), Boolean.TRUE); if (insertResult != Constants.EXIT_CODE_SUCCESS) { putMsg(result, Status.CREATE_PROCESS_TASK_RELATION_ERROR); throw new ServiceException(Status.CREATE_PROCESS_TASK_RELATION_ERROR); } int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, Lists.newArrayList(taskDefinition), Boolean.TRUE); if (saveTaskResult == Constants.DEFINITION_FAILURE) { putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR); } putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, taskDefinition); return result; } /** * query task definition * * @param loginUser login user
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
* @param projectCode project code * @param taskName task name */ @Override public Map<String, Object> queryTaskDefinitionByName(User loginUser, long projectCode, String taskName) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByName(project.getCode(), taskName); if (taskDefinition == null) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskName); } else { result.put(Constants.DATA_LIST, taskDefinition); putMsg(result, Status.SUCCESS); } return result; } /** * delete task definition * Only offline and no downstream dependency can be deleted * * @param loginUser login user * @param projectCode project code * @param taskCode task code */ @Transactional(rollbackFor = RuntimeException.class) @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
public Map<String, Object> deleteTaskDefinitionByCode(User loginUser, long projectCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (taskCode == 0) { putMsg(result, Status.DELETE_TASK_DEFINE_BY_CODE_ERROR); return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); return result; } if (processService.isTaskOnline(taskCode) && taskDefinition.getFlag() == Flag.YES) { putMsg(result, Status.TASK_DEFINE_STATE_ONLINE, taskCode); return result; } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryDownstreamByTaskCode(taskCode); if (!processTaskRelationList.isEmpty()) { Set<Long> postTaskCodes = processTaskRelationList .stream() .map(ProcessTaskRelation::getPostTaskCode) .collect(Collectors.toSet()); putMsg(result, Status.TASK_HAS_DOWNSTREAM, StringUtils.join(postTaskCodes, ",")); return result; } int delete = taskDefinitionMapper.deleteByCode(taskCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
if (delete > 0) { List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (!taskRelationList.isEmpty()) { long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); List<ProcessTaskRelation> relationList = processTaskRelations.stream().filter(r -> r.getPostTaskCode() != taskCode).collect(Collectors.toList()); updateDag(loginUser, result, processDefinitionCode, relationList, Lists.newArrayList()); } else { putMsg(result, Status.SUCCESS); } } else { putMsg(result, Status.DELETE_TASK_DEFINE_BY_CODE_ERROR); throw new ServiceException(Status.DELETE_TASK_DEFINE_BY_CODE_ERROR); } return result; } private void updateDag(User loginUser, Map<String, Object> result, long processDefinitionCode, List<ProcessTaskRelation> processTaskRelationList, List<TaskDefinitionLog> taskDefinitionLogs) { ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode); if (processDefinition == null) { throw new ServiceException(Status.PROCESS_DEFINE_NOT_EXIST); } int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE); if (insertVersion <= 0) { throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } List<ProcessTaskRelationLog> relationLogs = processTaskRelationList.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList()); int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), processDefinition.getCode(), insertVersion, relationLogs, taskDefinitionLogs, Boolean.TRUE); if (insertResult == Constants.EXIT_CODE_SUCCESS) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, processDefinition); } else { putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } } /** * update task definition * * @param loginUser login user * @param projectCode project code * @param taskCode task code * @param taskDefinitionJsonObj task definition json object */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> updateTaskDefinition(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj) { Map<String, Object> result = new HashMap<>(); TaskDefinitionLog taskDefinitionToUpdate = updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result); if (taskDefinitionToUpdate == null) { return result; } List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (!taskRelationList.isEmpty()) { long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); updateDag(loginUser, result, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionToUpdate)); } result.put(Constants.DATA_LIST, taskCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
putMsg(result, Status.SUCCESS); return result; } private TaskDefinitionLog updateTask(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj, Map<String, Object> result) { Project project = projectMapper.queryByCode(projectCode); result.putAll(projectService.checkProjectAndAuth(loginUser, project, projectCode)); if (result.get(Constants.STATUS) != Status.SUCCESS) { return null; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); return null; } if (processService.isTaskOnline(taskCode) && taskDefinition.getFlag() == Flag.YES) { putMsg(result, Status.NOT_SUPPORT_UPDATE_TASK_DEFINITION); return null; } TaskDefinitionLog taskDefinitionToUpdate = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class); if (taskDefinition.equals(taskDefinitionToUpdate)) { return null; } if (taskDefinitionToUpdate == null) { logger.error("taskDefinitionJson is not valid json"); putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj); return null; } if (!taskPluginManager.checkTaskParameters(ParametersNode.builder() .taskType(taskDefinitionToUpdate.getTaskType())
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
.taskParams(taskDefinitionToUpdate.getTaskParams()) .dependence(taskDefinitionToUpdate.getDependence()) .build())) { logger.error("task definition {} parameter invalid", taskDefinitionToUpdate.getName()); putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionToUpdate.getName()); return null; } Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskCode); if (version == null || version == 0) { putMsg(result, Status.DATA_IS_NOT_VALID, taskCode); return null; } Date now = new Date(); taskDefinitionToUpdate.setCode(taskCode); taskDefinitionToUpdate.setId(taskDefinition.getId()); taskDefinitionToUpdate.setProjectCode(projectCode); taskDefinitionToUpdate.setUserId(taskDefinition.getUserId()); taskDefinitionToUpdate.setVersion(++version); taskDefinitionToUpdate.setTaskType(taskDefinitionToUpdate.getTaskType().toUpperCase()); taskDefinitionToUpdate.setResourceIds(processService.getResourceIds(taskDefinitionToUpdate)); taskDefinitionToUpdate.setUpdateTime(now); int update = taskDefinitionMapper.updateById(taskDefinitionToUpdate); taskDefinitionToUpdate.setOperator(loginUser.getId()); taskDefinitionToUpdate.setOperateTime(now); taskDefinitionToUpdate.setCreateTime(now); int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate); if ((update & insert) != 1) { putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
return taskDefinitionToUpdate; } /** * update task definition and upstream * * @param loginUser login user * @param projectCode project code * @param taskCode task definition code * @param taskDefinitionJsonObj task definition json object * @param upstreamCodes upstream task codes, sep comma * @return update result code */ @Override public Map<String, Object> updateTaskWithUpstream(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj, String upstreamCodes) { Map<String, Object> result = new HashMap<>(); TaskDefinitionLog taskDefinitionToUpdate = updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result); if (result.get(Constants.STATUS) != Status.SUCCESS && taskDefinitionToUpdate == null) { return result; } List<ProcessTaskRelation> upstreamTaskRelations = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); Set<Long> upstreamCodeSet = upstreamTaskRelations.stream().map(ProcessTaskRelation::getPreTaskCode).collect(Collectors.toSet()); Set<Long> upstreamTaskCodes = Collections.emptySet(); if (StringUtils.isNotEmpty(upstreamCodes)) { upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong).collect(Collectors.toSet()); } if (CollectionUtils.isEqualCollection(upstreamCodeSet, upstreamTaskCodes) && taskDefinitionToUpdate == null) { putMsg(result, Status.SUCCESS); return result; } else { if (taskDefinitionToUpdate == null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
taskDefinitionToUpdate = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class); } } Map<Long, TaskDefinition> queryUpStreamTaskCodeMap; if (!upstreamTaskCodes.isEmpty()) { List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes); queryUpStreamTaskCodeMap = upstreamTaskDefinitionList.stream().collect(Collectors.toMap(TaskDefinition::getCode, taskDefinition -> taskDefinition)); upstreamTaskCodes.removeAll(queryUpStreamTaskCodeMap.keySet()); if (!upstreamTaskCodes.isEmpty()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, StringUtils.join(upstreamTaskCodes, Constants.COMMA)); return result; } } else { queryUpStreamTaskCodeMap = new HashMap<>(); } if (!upstreamTaskRelations.isEmpty()) { ProcessTaskRelation taskRelation = upstreamTaskRelations.get(0); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, taskRelation.getProcessDefinitionCode()); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); List<ProcessTaskRelation> relationList = Lists.newArrayList(); for (ProcessTaskRelation processTaskRelation : processTaskRelationList) { if (processTaskRelation.getPostTaskCode() == taskCode) { if (queryUpStreamTaskCodeMap.containsKey(processTaskRelation.getPreTaskCode()) && processTaskRelation.getPreTaskCode() != 0L) { queryUpStreamTaskCodeMap.remove(processTaskRelation.getPreTaskCode()); } else { processTaskRelation.setPreTaskCode(0L); processTaskRelation.setPreTaskVersion(0); relationList.add(processTaskRelation); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} } processTaskRelationList.removeAll(relationList); for (Map.Entry<Long, TaskDefinition> queryUpStreamTask : queryUpStreamTaskCodeMap.entrySet()) { taskRelation.setPreTaskCode(queryUpStreamTask.getKey()); taskRelation.setPreTaskVersion(queryUpStreamTask.getValue().getVersion()); processTaskRelationList.add(taskRelation); } if (queryUpStreamTaskCodeMap.isEmpty() && !processTaskRelationList.isEmpty()) { processTaskRelationList.add(processTaskRelationList.get(0)); } updateDag(loginUser, result, taskRelation.getProcessDefinitionCode(), processTaskRelations, Lists.newArrayList(taskDefinitionToUpdate)); } result.put(Constants.DATA_LIST, taskCode); putMsg(result, Status.SUCCESS); return result; } /** * switch task definition * * @param loginUser login user * @param projectCode project code * @param taskCode task code * @param version the version user want to switch */ @Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> switchVersion(User loginUser, long projectCode, long taskCode, int version) { Project project = projectMapper.queryByCode(projectCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (processService.isTaskOnline(taskCode)) { putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE); return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); return result; } TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version); taskDefinitionUpdate.setUserId(loginUser.getId()); taskDefinitionUpdate.setUpdateTime(new Date()); taskDefinitionUpdate.setId(taskDefinition.getId()); int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate); if (switchVersion > 0) { List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (!taskRelationList.isEmpty()) { long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); updateDag(loginUser, result, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionUpdate)); } else { putMsg(result, Status.SUCCESS); } } else { putMsg(result, Status.SWITCH_TASK_DEFINITION_VERSION_ERROR); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
return result; } @Override public Result queryTaskDefinitionVersions(User loginUser, long projectCode, long taskCode, int pageNo, int 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; } PageInfo<TaskDefinitionLog> pageInfo = new PageInfo<>(pageNo, pageSize); Page<TaskDefinitionLog> page = new Page<>(pageNo, pageSize); IPage<TaskDefinitionLog> taskDefinitionVersionsPaging = taskDefinitionLogMapper.queryTaskDefinitionVersionsPaging(page, taskCode, projectCode); List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionVersionsPaging.getRecords(); pageInfo.setTotalList(taskDefinitionLogs); pageInfo.setTotal((int) taskDefinitionVersionsPaging.getTotal()); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; } @Override public Map<String, Object> deleteByCodeAndVersion(User loginUser, long projectCode, long taskCode, int version) { Project project = projectMapper.queryByCode(projectCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); } else { if (taskDefinition.getVersion() == version) { putMsg(result, Status.MAIN_TABLE_USING_VERSION); return result; } int delete = taskDefinitionLogMapper.deleteByCodeAndVersion(taskCode, version); if (delete > 0) { putMsg(result, Status.SUCCESS); } else { putMsg(result, Status.DELETE_TASK_DEFINITION_VERSION_ERROR); } } return result; } @Override public Map<String, Object> queryTaskDefinitionDetail(User loginUser, long projectCode, long taskCode) { 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
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); } else { result.put(Constants.DATA_LIST, taskDefinition); putMsg(result, Status.SUCCESS); } return result; } @Override public Result queryTaskDefinitionListPaging(User loginUser, long projectCode, String searchWorkflowName, String searchTaskName, String taskType, 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<TaskMainInfo> page = new Page<>(pageNo, pageSize); IPage<TaskMainInfo> taskMainInfoIPage = taskDefinitionMapper.queryDefineListPaging(page, projectCode, searchWorkflowName, searchTaskName, taskType == null ? StringUtils.EMPTY : taskType); List<TaskMainInfo> records = taskMainInfoIPage.getRecords();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
if (!records.isEmpty()) { Map<Long, TaskMainInfo> taskMainInfoMap = new HashMap<>(); for (TaskMainInfo info : records) { taskMainInfoMap.compute(info.getTaskCode(), (k, v) -> { if (v == null) { Map<Long, String> upstreamTaskMap = new HashMap<>(); if (info.getUpstreamTaskCode() != 0) { upstreamTaskMap.put(info.getUpstreamTaskCode(), info.getUpstreamTaskName()); info.setUpstreamTaskCode(0L); info.setUpstreamTaskName(StringUtils.EMPTY); } info.setUpstreamTaskMap(upstreamTaskMap); v = info; } if (info.getUpstreamTaskCode() != 0) { v.getUpstreamTaskMap().put(info.getUpstreamTaskCode(), info.getUpstreamTaskName()); } return v; }); } taskMainInfoIPage.setRecords(Lists.newArrayList(taskMainInfoMap.values())); } PageInfo<TaskMainInfo> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotal((int) taskMainInfoIPage.getTotal()); pageInfo.setTotalList(taskMainInfoIPage.getRecords()); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; } @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
public Map<String, Object> genTaskCodeList(Integer genNum) { Map<String, Object> result = new HashMap<>(); if (genNum == null || genNum < 1 || genNum > 100) { logger.error("the genNum must be great than 1 and less than 100"); putMsg(result, Status.DATA_IS_NOT_VALID, genNum); return result; } List<Long> taskCodes = new ArrayList<>(); try { for (int i = 0; i < genNum; i++) { taskCodes.add(CodeGenerateUtils.getInstance().genCode()); } } catch (CodeGenerateException e) { logger.error("Task code get error, ", e); putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS, "Error generating task definition code"); } putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, taskCodes); return result; } /** * release task definition * * @param loginUser login user * @param projectCode project code * @param code task definition code * @param releaseState releaseState * @return update result code */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
@Transactional(rollbackFor = RuntimeException.class) @Override public Map<String, Object> releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode); Status resultStatus = (Status) result.get(Constants.STATUS); if (resultStatus != Status.SUCCESS) { return result; } if (null == releaseState) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(code); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, code); return result; } TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(code, taskDefinition.getVersion()); if (taskDefinitionLog == null) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, code); return result; } switch (releaseState) { case OFFLINE: taskDefinition.setFlag(Flag.NO); taskDefinitionLog.setFlag(Flag.NO); break; case ONLINE:
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,687
[BUG] [API] The alert format is wrong
### 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 The error message is not clear when workflow instance reRun failed ### What you expected to happen Prompt clear error message ### How to reproduce Create a workflow and set shell task Online and run it Offline and edit it Open workflow instance and reRun instance ![image](https://user-images.githubusercontent.com/36755957/164955507-cd6f0244-8f61-4615-9723-d880edabbe0b.png) ![image](https://user-images.githubusercontent.com/36755957/164955516-9b93857d-ce1d-426e-aa7e-84b504416efd.png) ### Anything else _No response_ ### Version dev ### 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/9687
https://github.com/apache/dolphinscheduler/pull/9689
99678c097c3a80757172aca038c4df15117effc4
a51b710b1c8ae43d9e9bcbc386af4d81fb7e6b65
2022-04-24T03:42:05Z
java
2022-04-24T05:29:27Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
String resourceIds = taskDefinition.getResourceIds(); if (StringUtils.isNotBlank(resourceIds)) { Integer[] resourceIdArray = Arrays.stream(resourceIds.split(",")).map(Integer::parseInt).toArray(Integer[]::new); PermissionCheck<Integer> permissionCheck = new PermissionCheck(AuthorizationType.RESOURCE_FILE_ID, processService, resourceIdArray, loginUser.getId(), logger); try { permissionCheck.checkPermission(); } catch (Exception e) { logger.error(e.getMessage(), e); putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION); return result; } } taskDefinition.setFlag(Flag.YES); taskDefinitionLog.setFlag(Flag.YES); break; default: putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } int update = taskDefinitionMapper.updateById(taskDefinition); int updateLog = taskDefinitionLogMapper.updateById(taskDefinitionLog); if ((update == 0 && updateLog == 1) || (update == 1 && updateLog == 0)) { putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR); } putMsg(result, Status.SUCCESS); return result; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.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 * limitations under the License. */ package org.apache.dolphinscheduler.server.master; import org.apache.dolphinscheduler.common.Constants;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
import org.apache.dolphinscheduler.common.IStoppable; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.apache.dolphinscheduler.server.log.LoggerRequestProcessor; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.processor.CacheProcessor; import org.apache.dolphinscheduler.server.master.processor.StateEventProcessor; import org.apache.dolphinscheduler.server.master.processor.TaskEventProcessor; import org.apache.dolphinscheduler.server.master.processor.TaskExecuteResponseProcessor; import org.apache.dolphinscheduler.server.master.processor.TaskExecuteRunningProcessor; import org.apache.dolphinscheduler.server.master.processor.TaskKillResponseProcessor; import org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient; import org.apache.dolphinscheduler.server.master.runner.EventExecuteService; import org.apache.dolphinscheduler.server.master.runner.FailoverExecuteThread; import org.apache.dolphinscheduler.server.master.runner.MasterSchedulerService; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import javax.annotation.PostConstruct; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.ComponentScan; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
@ComponentScan("org.apache.dolphinscheduler") @EnableTransactionManagement @EnableCaching public class MasterServer implements IStoppable { private static final Logger logger = LoggerFactory.getLogger(MasterServer.class); @Autowired private MasterConfig masterConfig; @Autowired private SpringApplicationContext springApplicationContext; private NettyRemotingServer nettyRemotingServer; @Autowired private MasterRegistryClient masterRegistryClient; @Autowired private MasterSchedulerService masterSchedulerService; @Autowired private Scheduler scheduler; @Autowired private TaskExecuteRunningProcessor taskExecuteRunningProcessor; @Autowired private TaskExecuteResponseProcessor taskExecuteResponseProcessor; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
private TaskEventProcessor taskEventProcessor; @Autowired private StateEventProcessor stateEventProcessor; @Autowired private CacheProcessor cacheProcessor; @Autowired private TaskKillResponseProcessor taskKillResponseProcessor; @Autowired private EventExecuteService eventExecuteService; @Autowired private FailoverExecuteThread failoverExecuteThread; @Autowired private LoggerRequestProcessor loggerRequestProcessor; public static void main(String[] args) { Thread.currentThread().setName(Constants.THREAD_NAME_MASTER_SERVER); SpringApplication.run(MasterServer.class); } /** * run master server */ @PostConstruct public void run() throws SchedulerException { NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(masterConfig.getListenPort()); this.nettyRemotingServer = new NettyRemotingServer(serverConfig); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE, taskExecuteResponseProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RUNNING, taskExecuteRunningProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_RESPONSE, taskKillResponseProcessor); this.nettyRemotingServer.registerProcessor(CommandType.STATE_EVENT_REQUEST, stateEventProcessor);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
this.nettyRemotingServer.registerProcessor(CommandType.TASK_FORCE_STATE_EVENT_REQUEST, taskEventProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_WAKEUP_EVENT_REQUEST, taskEventProcessor); this.nettyRemotingServer.registerProcessor(CommandType.CACHE_EXPIRE, cacheProcessor); this.nettyRemotingServer.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.start(); this.masterRegistryClient.init(); this.masterRegistryClient.start(); this.masterRegistryClient.setRegistryStoppable(this); this.masterSchedulerService.init(); this.masterSchedulerService.start(); this.eventExecuteService.start(); this.failoverExecuteThread.start(); this.scheduler.start(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { if (Stopper.isRunning()) { close("shutdownHook"); } })); } /** * gracefully close * * @param cause close cause */ public void close(String cause) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
try { if (Stopper.isStopped()) { return; } logger.info("master server is stopping ..., cause : {}", cause); Stopper.stop(); try { Thread.sleep(3000L); } catch (Exception e) { logger.warn("thread sleep exception ", e); } this.masterSchedulerService.close(); this.nettyRemotingServer.close(); this.masterRegistryClient.closeRegistry(); springApplicationContext.close(); } catch (Exception e) { logger.error("master server stop exception ", e); } } @Override public void stop(String cause) { close(cause); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/FailoverExecuteThread.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 * limitations under the License. */ package org.apache.dolphinscheduler.server.master.runner; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.service.FailoverService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/FailoverExecuteThread.java
public class FailoverExecuteThread extends Thread { private static final Logger logger = LoggerFactory.getLogger(FailoverExecuteThread.class); @Autowired private MasterConfig masterConfig; /** * failover service */ @Autowired private FailoverService failoverService; @Override public synchronized void start() { super.setName("FailoverExecuteThread"); super.start(); } @Override public void run() { logger.info("failover execute thread started"); while (Stopper.isRunning()) { try { failoverService.checkMasterFailover(); } catch (Exception e) { logger.error("failover execute error", e); } finally { ThreadUtils.sleep((long) Constants.SLEEP_TIME_MILLIS * masterConfig.getFailoverInterval() * 60); } } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.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 * limitations under the License. */ package org.apache.dolphinscheduler.server.master.runner; import org.apache.dolphinscheduler.common.Constants;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
import org.apache.dolphinscheduler.common.enums.SlotCheckState; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.remote.NettyRemotingClient; import org.apache.dolphinscheduler.remote.config.NettyClientConfig; import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager; import org.apache.dolphinscheduler.server.master.registry.ServerNodeManager; import org.apache.dolphinscheduler.service.alert.ProcessAlertManager; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.task.TaskPluginManager; import org.apache.commons.collections4.CollectionUtils; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadPoolExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * master scheduler thread */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
public class MasterSchedulerService extends Thread { /** * logger of MasterSchedulerService */ private static final Logger logger = LoggerFactory.getLogger(MasterSchedulerService.class); /** * dolphinscheduler database interface */ @Autowired private ProcessService processService; /** * master config */ @Autowired private MasterConfig masterConfig; /** * alert manager */ @Autowired private ProcessAlertManager processAlertManager; /** * netty remoting client */ private NettyRemotingClient nettyRemotingClient; @Autowired NettyExecutorManager nettyExecutorManager; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
* master prepare exec service */ private ThreadPoolExecutor masterPrepareExecService; /** * workflow exec service */ @Autowired private WorkflowExecuteThreadPool workflowExecuteThreadPool; @Autowired private ProcessInstanceExecCacheManager processInstanceExecCacheManager; @Autowired private StateWheelExecuteThread stateWheelExecuteThread; @Autowired private TaskPluginManager taskPluginManager; /** * constructor of MasterSchedulerService */ public void init() { this.masterPrepareExecService = (ThreadPoolExecutor) ThreadUtils.newDaemonFixedThreadExecutor("Master-Pre-Exec-Thread", masterConfig.getPreExecThreads()); NettyClientConfig clientConfig = new NettyClientConfig(); this.nettyRemotingClient = new NettyRemotingClient(clientConfig); } @Override public synchronized void start() { super.setName("MasterSchedulerService"); super.start(); this.stateWheelExecuteThread.start(); } public void close() { nettyRemotingClient.close();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
logger.info("master schedule service stopped..."); } /** * run of MasterSchedulerService */ @Override public void run() { logger.info("master scheduler started"); while (Stopper.isRunning()) { try { boolean runCheckFlag = OSUtils.checkResource(masterConfig.getMaxCpuLoadAvg(), masterConfig.getReservedMemory()); if (!runCheckFlag) { Thread.sleep(Constants.SLEEP_TIME_MILLIS); continue; } scheduleProcess(); } catch (Exception e) { logger.error("master scheduler thread error", e); } } } /** * 1. get command by slot * 2. donot handle command if slot is empty */ private void scheduleProcess() throws Exception { List<Command> commands = findCommands(); if (CollectionUtils.isEmpty(commands)) { Thread.sleep(Constants.SLEEP_TIME_MILLIS);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
return; } List<ProcessInstance> processInstances = command2ProcessInstance(commands); if (CollectionUtils.isEmpty(processInstances)) { return; } for (ProcessInstance processInstance : processInstances) { if (processInstance == null) { continue; } WorkflowExecuteThread workflowExecuteThread = new WorkflowExecuteThread( processInstance , processService , nettyExecutorManager , processAlertManager , masterConfig , stateWheelExecuteThread); this.processInstanceExecCacheManager.cache(processInstance.getId(), workflowExecuteThread); if (processInstance.getTimeout() > 0) { stateWheelExecuteThread.addProcess4TimeoutCheck(processInstance); } workflowExecuteThreadPool.startWorkflow(workflowExecuteThread); } } private List<ProcessInstance> command2ProcessInstance(List<Command> commands) { List<ProcessInstance> processInstances = Collections.synchronizedList(new ArrayList<>(commands.size())); CountDownLatch latch = new CountDownLatch(commands.size()); for (final Command command : commands) { masterPrepareExecService.execute(() -> { try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
SlotCheckState slotCheckState = slotCheck(command); if (slotCheckState.equals(SlotCheckState.CHANGE) || slotCheckState.equals(SlotCheckState.INJECT)) { logger.info("handle command {} skip, slot check state: {}", command.getId(), slotCheckState); return; } ProcessInstance processInstance = processService.handleCommand(logger, getLocalAddress(), command); if (processInstance != null) { processInstances.add(processInstance); logger.info("handle command {} end, create process instance {}", command.getId(), processInstance.getId()); } } catch (Exception e) { logger.error("handle command error ", e); processService.moveToErrorCommand(command, e.toString()); } finally { latch.countDown(); } }); } try { latch.await(); } catch (InterruptedException e) { logger.error("countDownLatch await error ", e); } return processInstances; } private List<Command> findCommands() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
int pageNumber = 0; int pageSize = masterConfig.getFetchCommandNum(); List<Command> result = new ArrayList<>(); if (Stopper.isRunning()) { int thisMasterSlot = ServerNodeManager.getSlot(); int masterCount = ServerNodeManager.getMasterSize(); if (masterCount > 0) { result = processService.findCommandPageBySlot(pageSize, pageNumber, masterCount, thisMasterSlot); } } return result; } private SlotCheckState slotCheck(Command command) { int slot = ServerNodeManager.getSlot(); int masterSize = ServerNodeManager.getMasterSize(); SlotCheckState state; if (masterSize <= 0) { state = SlotCheckState.CHANGE; } else if (command.getId() % masterSize == slot) { state = SlotCheckState.PASS; } else { state = SlotCheckState.INJECT; } return state; } private String getLocalAddress() { return NetUtils.getAddr(masterConfig.getListenPort()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java
* 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 * limitations under the License. */ package org.apache.dolphinscheduler.service.task; import static java.lang.String.format; import org.apache.dolphinscheduler.common.enums.PluginType; import org.apache.dolphinscheduler.dao.PluginDao; import org.apache.dolphinscheduler.dao.entity.PluginDefine; import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer; import org.apache.dolphinscheduler.spi.params.base.PluginParams; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.ServiceLoader; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java
public class TaskPluginManager { private static final Logger logger = LoggerFactory.getLogger(TaskPluginManager.class); private final Map<String, TaskChannel> taskChannelMap = new ConcurrentHashMap<>(); private final PluginDao pluginDao; public TaskPluginManager(PluginDao pluginDao) { this.pluginDao = pluginDao; } private void loadTaskChannel(TaskChannelFactory taskChannelFactory) { TaskChannel taskChannel = taskChannelFactory.create(); taskChannelMap.put(taskChannelFactory.getName(), taskChannel); } public Map<String, TaskChannel> getTaskChannelMap() { return Collections.unmodifiableMap(taskChannelMap); } public TaskChannel getTaskChannel(String type) { return this.getTaskChannelMap().get(type); } public boolean checkTaskParameters(ParametersNode parametersNode) { AbstractParameters abstractParameters = this.getParameters(parametersNode); return abstractParameters != null && abstractParameters.checkParameters(); } public AbstractParameters getParameters(ParametersNode parametersNode) { String taskType = parametersNode.getTaskType(); if (Objects.isNull(taskType)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java
return null; } TaskChannel taskChannel = this.getTaskChannelMap().get(taskType); if (Objects.isNull(taskChannel)) { return null; } return taskChannel.parseParameters(parametersNode); } @EventListener public void installPlugin(ApplicationReadyEvent readyEvent) { final Set<String> names = new HashSet<>(); ServiceLoader.load(TaskChannelFactory.class).forEach(factory -> { final String name = factory.getName(); logger.info("Registering task plugin: {}", name); if (!names.add(name)) { throw new IllegalStateException(format("Duplicate task plugins named '%s'", name)); } loadTaskChannel(factory); logger.info("Registered task plugin: {}", name); List<PluginParams> params = factory.getParams(); String paramsJson = PluginParamsTransfer.transferParamsToJson(params); PluginDefine pluginDefine = new PluginDefine(name, PluginType.TASK.getDesc(), paramsJson); int count = pluginDao.addOrUpdatePluginDefine(pluginDefine); if (count <= 0) { throw new RuntimeException("Failed to update task plugin: " + name); } }); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.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 * limitations under the License. */ package org.apache.dolphinscheduler.server.worker; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.IStoppable; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.thread.Stopper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContextCacheManager; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.apache.dolphinscheduler.server.log.LoggerRequestProcessor; import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; import org.apache.dolphinscheduler.server.worker.processor.HostUpdateProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteResponseAckProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteRunningAckProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor; import org.apache.dolphinscheduler.server.worker.registry.WorkerRegistryClient; import org.apache.dolphinscheduler.server.worker.runner.RetryReportTaskStatusThread; import org.apache.dolphinscheduler.server.worker.runner.WorkerManagerThread; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.task.TaskPluginManager; import org.apache.commons.collections4.CollectionUtils; import java.util.Collection; import java.util.Set; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
@EnableTransactionManagement @ComponentScan("org.apache.dolphinscheduler") public class WorkerServer implements IStoppable { /** * logger */ private static final Logger logger = LoggerFactory.getLogger(WorkerServer.class); /** * netty remote server */ private NettyRemotingServer nettyRemotingServer; /** * worker config */ @Autowired private WorkerConfig workerConfig; /** * spring application context * only use it for initialization */ @Autowired private SpringApplicationContext springApplicationContext; /** * alert model netty remote server */ @Autowired private AlertClientService alertClientService; @Autowired private RetryReportTaskStatusThread retryReportTaskStatusThread;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
@Autowired private WorkerManagerThread workerManagerThread; /** * worker registry */ @Autowired private WorkerRegistryClient workerRegistryClient; @Autowired private TaskPluginManager taskPluginManager; @Autowired private TaskExecuteProcessor taskExecuteProcessor; @Autowired private TaskKillProcessor taskKillProcessor; @Autowired private TaskExecuteRunningAckProcessor taskExecuteRunningAckProcessor; @Autowired private TaskExecuteResponseAckProcessor taskExecuteResponseAckProcessor; @Autowired private HostUpdateProcessor hostUpdateProcessor; @Autowired private LoggerRequestProcessor loggerRequestProcessor; /** * worker server startup, not use web service * * @param args arguments */ public static void main(String[] args) { Thread.currentThread().setName(Constants.THREAD_NAME_WORKER_SERVER); SpringApplication.run(WorkerServer.class); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
/** * worker server run */ @PostConstruct public void run() { NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(workerConfig.getListenPort()); this.nettyRemotingServer = new NettyRemotingServer(serverConfig); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, taskExecuteProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, taskKillProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RUNNING_ACK, taskExecuteRunningAckProcessor); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE_ACK, taskExecuteResponseAckProcessor); this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, hostUpdateProcessor); this.nettyRemotingServer.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, loggerRequestProcessor); this.nettyRemotingServer.start(); try { this.workerRegistryClient.registry(); this.workerRegistryClient.setRegistryStoppable(this); Set<String> workerZkPaths = this.workerRegistryClient.getWorkerZkPaths(); this.workerRegistryClient.handleDeadServer(workerZkPaths, NodeType.WORKER, Constants.DELETE_OP); } catch (Exception e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
this.workerManagerThread.start(); this.retryReportTaskStatusThread.start(); /* * registry hooks, which are called before the process exits */ Runtime.getRuntime().addShutdownHook(new Thread(() -> { if (Stopper.isRunning()) { close("shutdownHook"); } })); } public void close(String cause) { try { if (Stopper.isStopped()) { return; } logger.info("worker server is stopping ..., cause : {}", cause); Stopper.stop(); try { Thread.sleep(3000L); } catch (Exception e) { logger.warn("thread sleep exception", e); } this.nettyRemotingServer.close();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,719
[Bug] [Master] Failover process instance fail
### 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 ``` [INFO] 2022-04-24 17:42:38.280 org.whaleops.service.process.WhaleProcessService:[1245] - start submit task : c, instance id:132, state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.284 org.whaleops.service.process.WhaleProcessService:[1259] - end submit task to db successfully:240 c state:SUBMITTED_SUCCESS complete, instance id:132 state: RUNNING_EXECUTION [INFO] 2022-04-24 17:42:38.287 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[113] - task ready to submit: TaskInstance{id=240, name='c', taskType='SHELL', processInstanceId=132, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Sun Apr 24 17:42:38 CST 2022, submitTime=Sun Apr 24 17:42:38 CST 2022, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=ProcessInstance{id=132, state=RUNNING_EXECUTION, recovery=YES, startTime=Sun Apr 24 17:42:10 CST 2022, endTime=null, runTimes=1, name='c-4-20220424174210410', host='192.168.1.5:5688', processDefinition=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, commandType=RECOVER_TOLERANCE_FAULT_PROCESS, commandParam='{}', taskDependType=TASK_POST, maxTryTimes=0, failureStrategy=CONTINUE, warningType=NONE, warningGroupId=0, scheduleTime=null, commandStartTime=Sun Apr 24 17:42:09 CST 2022, globalParams='null', executorId=1, tenantCode='null', queue='null', isSubProcess=NO, locations='null', historyCmd='START_PROCESS,RECOVER_TOLERANCE_FAULT_PROCESS', dependenceScheduleTimes='null', duration=null, processInstancePriority=MEDIUM, workerGroup='default', timeout=0, tenantId=1, processDefinitionCode='5293486169440', processDefinitionVersion='4', dryRun='0'}, restartTime='Sun Apr 24 17:42:38 CST 2022', isBlocked=false}, processDefine=ProcessDefinition{id=6, code=5293486169440, name='c', version=4, releaseState=ONLINE, projectCode=5227955009248, description='', globalParams='[]', globalParamList=[], globalParamMap=null, createTime=Sun Apr 24 15:36:01 CST 2022, updateTime=Sun Apr 24 17:26:40 CST 2022, flag=YES, userId=1, userName='null', projectName='null', locations='[{"taskCode":5293484338912,"x":290,"y":178}]', scheduleReleaseState=null, timeout=0, tenantId=1, tenantCode='null', modifyBy='null', warningGroupId=0}, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [ERROR] 2022-04-24 17:42:38.295 TaskLogLogger-class org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[131] - submit task error java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.getTaskExecutionContext(BaseTaskProcessor.java:273) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.dispatchTask(CommonTaskProcessor.java:119) at org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor.submitTask(CommonTaskProcessor.java:70) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.submit(BaseTaskProcessor.java:193) at org.apache.dolphinscheduler.server.master.runner.task.BaseTaskProcessor.action(BaseTaskProcessor.java:179) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:978) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1814) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:1336) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:795) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [INFO] 2022-04-24 17:42:38.295 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1719] - remove task from stand by list, id: 240 name:c [INFO] 2022-04-24 17:42:38.316 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: createScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.317 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: deleteScheduleByIdUsingDELETE_1 [INFO] 2022-04-24 17:42:38.318 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: previewScheduleUsingPOST_1 [INFO] 2022-04-24 17:42:38.319 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: queryScheduleListPagingUsingGET_1 [INFO] 2022-04-24 17:42:38.322 springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator:[40] - Generating unique operation named: updateScheduleUsingPUT_1 [INFO] 2022-04-24 17:42:38.356 org.whaleops.WhaleStandaloneServer:[61] - Started WhaleStandaloneServer in 11.038 seconds (JVM running for 13.309) [INFO] 2022-04-24 17:42:38.373 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.374 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: CONDITIONS [INFO] 2022-04-24 17:42:38.377 org.apache.dolphinscheduler.spi.utils.JSONUtils:[59] - init timezone: sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null] [INFO] 2022-04-24 17:42:38.385 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.386 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATA_QUALITY [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DATAX [INFO] 2022-04-24 17:42:38.391 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DATAX [INFO] 2022-04-24 17:42:38.393 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.394 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: DEPENDENT [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: FLINK [INFO] 2022-04-24 17:42:38.396 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: FLINK [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: HTTP [INFO] 2022-04-24 17:42:38.398 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: HTTP [INFO] 2022-04-24 17:42:38.400 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: MR [INFO] 2022-04-24 17:42:38.401 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: MR [INFO] 2022-04-24 17:42:38.406 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PIGEON [INFO] 2022-04-24 17:42:38.407 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PIGEON [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.410 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PROCEDURE [INFO] 2022-04-24 17:42:38.412 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: PYTHON [INFO] 2022-04-24 17:42:38.413 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: PYTHON [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.415 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SEATUNNEL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SHELL [INFO] 2022-04-24 17:42:38.418 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SHELL [INFO] 2022-04-24 17:42:38.423 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SPARK [INFO] 2022-04-24 17:42:38.425 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SPARK [INFO] 2022-04-24 17:42:38.427 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQL [INFO] 2022-04-24 17:42:38.428 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQL [INFO] 2022-04-24 17:42:38.429 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SQOOP [INFO] 2022-04-24 17:42:38.430 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SQOOP [INFO] 2022-04-24 17:42:38.431 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.432 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SUB_PROCESS [INFO] 2022-04-24 17:42:38.434 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: SWITCH [INFO] 2022-04-24 17:42:38.435 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: SWITCH [INFO] 2022-04-24 17:42:38.437 org.apache.dolphinscheduler.service.task.TaskPluginManager:[96] - Registering task plugin: EMR [INFO] 2022-04-24 17:42:38.438 org.apache.dolphinscheduler.service.task.TaskPluginManager:[104] - Registered task plugin: EMR ``` ### What you expected to happen can failover normally when master startup. ### How to reproduce create a workflow with a long time task, run workflow and then close the server (master and worker) start server(worker and master). ### Anything else _No response_ ### Version dev ### 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/9719
https://github.com/apache/dolphinscheduler/pull/9720
ebc4253d5020c0bf319561985c0c25bace5c283b
5657cb9aecfd2ce6b87fb5340439cdf4c1c2bb9a
2022-04-24T10:52:04Z
java
2022-04-24T12:34:21Z
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
this.workerRegistryClient.unRegistry(); this.alertClientService.close(); this.killAllRunningTasks(); this.springApplicationContext.close(); } catch (Exception e) { logger.error("worker server stop exception ", e); } } @Override public void stop(String cause) { close(cause); } /** * kill all tasks which are running */ public void killAllRunningTasks() { Collection<TaskExecutionContext> taskRequests = TaskExecutionContextCacheManager.getAllTaskRequestList(); logger.info("ready to kill all cache job, job size:{}", taskRequests.size()); if (CollectionUtils.isEmpty(taskRequests)) { return; } for (TaskExecutionContext taskRequest : taskRequests) { org.apache.dolphinscheduler.plugin.task.api.ProcessUtils.kill(taskRequest); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,737
[Bug] [WorkFlow] Failed to create workflow prompt parameter
### 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 Failed to create workflow prompt parameter ### What you expected to happen 1. save workflow ### How to reproduce 1. create workflow 2. save workflow ### Anything else ![Kapture 2022-04-25 at 10 13 42](https://user-images.githubusercontent.com/42627702/165009736-086901e2-19b5-4e18-903c-c9b0f69aa6e6.gif) ### Version dev ### Are you willing to submit PR? - [ ] 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/9737
https://github.com/apache/dolphinscheduler/pull/9744
1f9660b80dc3954b3523e29b5230d65db6d31bf6
0176f4bf61132d48eff13793bea92ffbb0e174ba
2022-04-25T02:16:17Z
java
2022-04-25T05:26:34Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.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 * limitations under the License. */ package org.apache.dolphinscheduler.api; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.ComponentScan; @ServletComponentScan @SpringBootApplication @ComponentScan("org.apache.dolphinscheduler") public class ApiApplicationServer { public static void main(String[] args) { SpringApplication.run(ApiApplicationServer.class); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
* 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 * limitations under the License. */ package org.apache.dolphinscheduler.service.process; import static java.util.stream.Collectors.toSet; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_EMPTY_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_FATHER_PARAMS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; import static org.apache.dolphinscheduler.common.Constants.LOCAL_PARAMS; import static org.apache.dolphinscheduler.plugin.task.api.utils.DataQualityConstants.TASK_INSTANCE_ID; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TaskGroupQueueStatus;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
import org.apache.dolphinscheduler.common.enums.TimeoutFlag; import org.apache.dolphinscheduler.common.enums.WarningType; 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.process.ProcessDag; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.DagData; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition; import org.apache.dolphinscheduler.dao.entity.DqComparisonType; import org.apache.dolphinscheduler.dao.entity.DqExecuteResult; import org.apache.dolphinscheduler.dao.entity.DqRule; import org.apache.dolphinscheduler.dao.entity.DqRuleExecuteSql; import org.apache.dolphinscheduler.dao.entity.DqRuleInputEntry; import org.apache.dolphinscheduler.dao.entity.DqTaskStatisticsValue; import org.apache.dolphinscheduler.dao.entity.Environment; import org.apache.dolphinscheduler.dao.entity.ErrorCommand; 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.ProcessInstanceMap; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog; import org.apache.dolphinscheduler.dao.entity.Project;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.Resource; 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.TaskGroup; import org.apache.dolphinscheduler.dao.entity.TaskGroupQueue; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.dao.entity.UdfFunc; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.CommandMapper; import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.DqComparisonTypeMapper; import org.apache.dolphinscheduler.dao.mapper.DqExecuteResultMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleExecuteSqlMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleInputEntryMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleMapper; import org.apache.dolphinscheduler.dao.mapper.DqTaskStatisticsValueMapper; import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper; import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
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.TaskGroupMapper; import org.apache.dolphinscheduler.dao.mapper.TaskGroupQueueMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.TenantMapper; import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.dao.mapper.WorkFlowLineageMapper; import org.apache.dolphinscheduler.dao.utils.DagHelper; import org.apache.dolphinscheduler.dao.utils.DqRuleUtils; import org.apache.dolphinscheduler.plugin.task.api.enums.Direct; import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DqTaskState; import org.apache.dolphinscheduler.plugin.task.api.model.DateInterval; import org.apache.dolphinscheduler.plugin.task.api.model.Property; import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; import org.apache.dolphinscheduler.plugin.task.api.parameters.SubProcessParameters; import org.apache.dolphinscheduler.plugin.task.api.parameters.TaskTimeoutParameter; import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand; import org.apache.dolphinscheduler.remote.command.TaskEventChangeCommand; import org.apache.dolphinscheduler.remote.processor.StateEventCallbackService; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.exceptions.ServiceException; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
import org.apache.dolphinscheduler.service.task.TaskPluginManager; import org.apache.dolphinscheduler.spi.enums.ResourceType; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.Lists; /** * process relative dao that some mappers in this. */ @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
public class ProcessServiceImpl implements ProcessService { private final Logger logger = LoggerFactory.getLogger(getClass()); private final int[] stateArray = new int[] {ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.DISPATCH.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal()}; @Autowired private UserMapper userMapper; @Autowired private ProcessDefinitionMapper processDefineMapper; @Autowired private ProcessDefinitionLogMapper processDefineLogMapper; @Autowired private ProcessInstanceMapper processInstanceMapper; @Autowired private DataSourceMapper dataSourceMapper; @Autowired private ProcessInstanceMapMapper processInstanceMapMapper; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private CommandMapper commandMapper; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
private ScheduleMapper scheduleMapper; @Autowired private UdfFuncMapper udfFuncMapper; @Autowired private ResourceMapper resourceMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ErrorCommandMapper errorCommandMapper; @Autowired private TenantMapper tenantMapper; @Autowired private ProjectMapper projectMapper; @Autowired private DqExecuteResultMapper dqExecuteResultMapper; @Autowired private DqRuleMapper dqRuleMapper; @Autowired private DqRuleInputEntryMapper dqRuleInputEntryMapper; @Autowired private DqRuleExecuteSqlMapper dqRuleExecuteSqlMapper; @Autowired private DqComparisonTypeMapper dqComparisonTypeMapper; @Autowired private DqTaskStatisticsValueMapper dqTaskStatisticsValueMapper; @Autowired private TaskDefinitionMapper taskDefinitionMapper; @Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,729
[BUG-BE][MASTER] The startup global parameter was not working.
### 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 The startup parameter was not working when I created a workflow without the global variables. ### What you expected to happen The startup parameter should be working. ### How to reproduce Create a workflow without setting the global variables. Start the workflow with the startup parameter. Check the task instance log. ### Anything else ### Version dev ### 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/9729
https://github.com/apache/dolphinscheduler/pull/9730
9abcbbac2ebf71c2e2966d37ddadf122a6f2122f
e6dade71bb1a30e2499d51af8da20b245e319608
2022-04-24T15:44:00Z
java
2022-04-25T06:05:40Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private ProcessTaskRelationLogMapper processTaskRelationLogMapper; @Autowired StateEventCallbackService stateEventCallbackService; @Autowired private EnvironmentMapper environmentMapper; @Autowired private TaskGroupQueueMapper taskGroupQueueMapper; @Autowired private TaskGroupMapper taskGroupMapper; @Autowired private WorkFlowLineageMapper workFlowLineageMapper; @Autowired private TaskPluginManager taskPluginManager; /** * handle Command (construct ProcessInstance from Command) , wrapped in transaction * * @param logger logger * @param host host * @param command found command * @return process instance */ @Override @Transactional public ProcessInstance handleCommand(Logger logger, String host, Command command) { ProcessInstance processInstance = constructProcessInstance(command, host); if (processInstance == null) { logger.error("scan command, command parameter is error: {}", command);