status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate vod ntTaskQueue() {
taskFaledSubmt = false;
actveTaskProcessorMaps.clear();
dependFaledTask.clear();
completeTaskLst.clear();
errorTaskLst.clear();
Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(processInstance.getId());
for (TaskInstance task : taskInstanceLst) {
f (task.sTaskComplete()) {
completeTaskLst.put(Long.toStrng(task.getTaskCode()), task);
}
f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) {
contnue;
}
f (task.getState().typeIsFalure() && !task.taskCanRetry()) {
errorTaskLst.put(Long.toStrng(task.getTaskCode()), task);
}
}
f (processInstance.sComplementData() && complementLstDate.sze() == 0) {
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
f (cmdParam != null && cmdParam.contansKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) {
Date start = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE));
Date end = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE));
Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode(processInstance.getProcessDefntonCode());
f (complementLstDate.sze() == 0 && needComplementProcess()) {
complementLstDate = CronUtls.getSelfFreDateLst(start, end, schedules);
logger.nfo(" process defnton code:{} complement data: {}",
processInstance.getProcessDefntonCode(), complementLstDate.toStrng());
f (complementLstDate.sze() > 0 && Flag.NO == processInstance.getIsSubProcess()) {
processInstance.setScheduleTme(complementLstDate.get(0)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | processInstance.setGlobalParams(ParameterUtls.curngGlobalParams(
processDefnton.getGlobalParamMap(),
processDefnton.getGlobalParamLst(),
CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme()));
processServce.updateProcessInstance(processInstance);
}
}
}
}
}
/**
* submt task to execute
*
* @param taskInstance task nstance
* @return TaskInstance
*/
prvate TaskInstance submtTaskExec(TaskInstance taskInstance) {
try {
ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType());
f (taskInstance.getState() == ExecutonStatus.RUNNING_EXECUTION
&& taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) {
notfyProcessHostUpdate(taskInstance);
}
boolean submt = taskProcessor.submt(taskInstance, processInstance, masterConfg.getMasterTaskCommtRetryTmes(), masterConfg.getMasterTaskCommtInterval());
f (submt) {
ths.taskInstanceHashMap.put(taskInstance.getId(), taskInstance.getTaskCode(), taskInstance);
actveTaskProcessorMaps.put(taskInstance.getId(), taskProcessor);
taskProcessor.run();
addTmeoutCheck(taskInstance);
TaskDefnton taskDefnton = processServce.fndTaskDefnton( |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.getTaskCode(),
taskInstance.getTaskDefntonVerson());
taskInstance.setTaskDefne(taskDefnton);
f (taskProcessor.taskState().typeIsFnshed()) {
StateEvent stateEvent = new StateEvent();
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setExecutonStatus(taskProcessor.taskState());
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
ths.stateEvents.add(stateEvent);
}
return taskInstance;
} else {
logger.error("process d:{} name:{} submt standby task d:{} name:{} faled!",
processInstance.getId(), processInstance.getName(),
taskInstance.getId(), taskInstance.getName());
return null;
}
} catch (Excepton e) {
logger.error("submt standby task error", e);
return null;
}
}
prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) {
f (StrngUtls.sEmpty(taskInstance.getHost())) {
return;
}
try {
HostUpdateCommand hostUpdateCommand = new HostUpdateCommand();
hostUpdateCommand.setProcessHost(NetUtls.getAddr(masterConfg.getLstenPort())); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | hostUpdateCommand.setTaskInstanceId(taskInstance.getId());
Host host = new Host(taskInstance.getHost());
nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command());
} catch (Excepton e) {
logger.error("notfy process host update", e);
}
}
prvate vod addTmeoutCheck(TaskInstance taskInstance) {
f (taskTmeoutCheckLst.contansKey(taskInstance.getId())) {
return;
}
TaskDefnton taskDefnton = processServce.fndTaskDefnton(
taskInstance.getTaskCode(),
taskInstance.getTaskDefntonVerson()
);
taskInstance.setTaskDefne(taskDefnton);
f (TmeoutFlag.OPEN == taskDefnton.getTmeoutFlag() || taskInstance.taskCanRetry()) {
ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance);
} else {
f (taskInstance.sDependTask() || taskInstance.sSubProcess()) {
ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance);
}
}
}
/**
* fnd task nstance n db.
* n case submt more than one same name task n the same tme.
*
* @param taskCode task code
* @param taskVerson task verson |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @return TaskInstance
*/
prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) {
Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(ths.processInstance.getId());
for (TaskInstance taskInstance : taskInstanceLst) {
f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) {
return taskInstance;
}
}
return null;
}
/**
* encapsulaton task
*
* @param processInstance process nstance
* @param taskNode taskNode
* @return TaskInstance
*/
prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) {
TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson());
f (taskInstance == null) {
taskInstance = new TaskInstance();
taskInstance.setTaskCode(taskNode.getCode());
taskInstance.setTaskDefntonVerson(taskNode.getVerson());
taskInstance.setName(taskNode.getName());
taskInstance.setState(ExecutonStatus.SUBMITTED_SUCCESS);
taskInstance.setProcessInstanceId(processInstance.getId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setTaskType(taskNode.getType().toUpperCase());
taskInstance.setAlertFlag(Flag.NO);
taskInstance.setStartTme(null);
taskInstance.setFlag(Flag.YES);
taskInstance.setDryRun(processInstance.getDryRun());
taskInstance.setRetryTmes(0);
taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes());
taskInstance.setRetryInterval(taskNode.getRetryInterval());
taskInstance.setTaskParams(taskNode.getTaskParams());
f (taskNode.getTaskInstanceProrty() == null) {
taskInstance.setTaskInstanceProrty(Prorty.MEDIUM);
} else {
taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty());
}
Strng processWorkerGroup = processInstance.getWorkerGroup();
processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup;
Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup();
Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode();
Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode();
f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setWorkerGroup(processWorkerGroup);
taskInstance.setEnvronmentCode(processEnvronmentCode);
} else {
taskInstance.setWorkerGroup(taskWorkerGroup);
taskInstance.setEnvronmentCode(taskEnvronmentCode);
}
f (!taskInstance.getEnvronmentCode().equals(-1L)) {
Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode());
f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) {
taskInstance.setEnvronmentConfg(envronment.getConfg());
}
}
taskInstance.setDelayTme(taskNode.getDelayTme());
}
return taskInstance;
}
publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) {
Map<Strng, Property> allProperty = new HashMap<>();
Map<Strng, TaskInstance> allTaskInstance = new HashMap<>();
f (CollectonUtls.sNotEmpty(preTask)) {
for (Strng preTaskCode : preTask) {
TaskInstance preTaskInstance = completeTaskLst.get(preTaskCode);
f (preTaskInstance == null) {
contnue;
}
Strng preVarPool = preTaskInstance.getVarPool();
f (StrngUtls.sNotEmpty(preVarPool)) {
Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class);
for (Property nfo : propertes) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo);
}
}
}
f (allProperty.sze() > 0) {
taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values()));
}
}
}
prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) {
thsProperty.setDrect(Drect.IN);
Strng proName = thsProperty.getProp();
f (allProperty.contansKey(proName)) {
Property otherPro = allProperty.get(proName);
f (StrngUtls.sEmpty(thsProperty.getValue())) {
allProperty.put(proName, otherPro);
} else f (StrngUtls.sNotEmpty(otherPro.getValue())) {
TaskInstance otherTask = allTaskInstance.get(proName);
f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
} else {
allProperty.put(proName, otherPro);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | } else {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
}
} else {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
}
}
prvate vod submtPostNode(Strng parentNodeCode) {
Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeCode, skpTaskNodeLst, dag, completeTaskLst);
Lst<TaskInstance> taskInstances = new ArrayLst<>();
for (Strng taskNode : submtTaskNodeLst) {
TaskNode taskNodeObject = dag.getNode(taskNode);
f (taskInstanceHashMap.contansColumn(taskNodeObject.getCode())) {
contnue;
}
TaskInstance task = createTaskInstance(processInstance, taskNodeObject);
taskInstances.add(task);
}
for (TaskInstance task : taskInstances) {
f (readyToSubmtTaskQueue.contans(task)) {
contnue;
}
f (completeTaskLst.contansKey(Long.toStrng(task.getTaskCode()))) {
logger.nfo("task {} has already run success", task.getName());
contnue;
}
f (task.getState().typeIsPause() || task.getState().typeIsCancel()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | logger.nfo("task {} stopped, the state s {}", task.getName(), task.getState());
} else {
addTaskToStandByLst(task);
}
}
submtStandByTask();
updateProcessInstanceState();
}
/**
* determne whether the dependences of the task node are complete
*
* @return DependResult
*/
prvate DependResult sTaskDepsComplete(Strng taskCode) {
Collecton<Strng> startNodes = dag.getBegnNode();
f (startNodes.contans(taskCode)) {
return DependResult.SUCCESS;
}
TaskNode taskNode = dag.getNode(taskCode);
Lst<Strng> depCodeLst = taskNode.getDepLst();
for (Strng depsNode : depCodeLst) {
f (!dag.contansNode(depsNode)
|| forbddenTaskLst.contansKey(depsNode)
|| skpTaskNodeLst.contansKey(depsNode)) {
contnue;
}
f (!completeTaskLst.contansKey(depsNode)) {
return DependResult.WAITING; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
ExecutonStatus depTaskState = completeTaskLst.get(depsNode).getState();
f (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) {
return DependResult.NON_EXEC;
}
f (taskNode.sCondtonsTask()) {
contnue;
}
f (!dependTaskSuccess(depsNode, taskCode)) {
return DependResult.FAILED;
}
}
logger.nfo("taskCode: {} completeDependTaskLst: {}", taskCode, Arrays.toStrng(completeTaskLst.keySet().toArray()));
return DependResult.SUCCESS;
}
/**
* depend node s completed, but here need check the condton task branch s the next node
*/
prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) {
f (dag.getNode(dependNodeName).sCondtonsTask()) {
Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeLst, dag, completeTaskLst);
f (!nextTaskLst.contans(nextNodeName)) {
return false;
}
} else {
ExecutonStatus depTaskState = completeTaskLst.get(dependNodeName).getState();
f (depTaskState.typeIsFalure()) {
return false; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
}
return true;
}
/**
* query task nstance by complete state
*
* @param state state
* @return task nstance lst
*/
prvate Lst<TaskInstance> getCompleteTaskByState(ExecutonStatus state) {
Lst<TaskInstance> resultLst = new ArrayLst<>();
for (Map.Entry<Strng, TaskInstance> entry : completeTaskLst.entrySet()) {
f (entry.getValue().getState() == state) {
resultLst.add(entry.getValue());
}
}
return resultLst;
}
/**
* where there are ongong tasks
*
* @param state state
* @return ExecutonStatus
*/
prvate ExecutonStatus runnngState(ExecutonStatus state) {
f (state == ExecutonStatus.READY_STOP
|| state == ExecutonStatus.READY_PAUSE
|| state == ExecutonStatus.WAITING_THREAD
|| state == ExecutonStatus.DELAY_EXECUTION) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | return state;
} else {
return ExecutonStatus.RUNNING_EXECUTION;
}
}
/**
* exsts falure task,contans submt falure、dependency falure,execute falure(retry after)
*
* @return Boolean whether has faled task
*/
prvate boolean hasFaledTask() {
f (ths.taskFaledSubmt) {
return true;
}
f (ths.errorTaskLst.sze() > 0) {
return true;
}
return ths.dependFaledTask.sze() > 0;
}
/**
* process nstance falure
*
* @return Boolean whether process nstance faled
*/
prvate boolean processFaled() {
f (hasFaledTask()) {
f (processInstance.getFalureStrategy() == FalureStrategy.END) {
return true;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE) {
return readyToSubmtTaskQueue.sze() == 0 || actveTaskProcessorMaps.sze() == 0;
}
}
return false;
}
/**
* whether task for watng thread
*
* @return Boolean whether has watng thread task
*/
prvate boolean hasWatngThreadTask() {
Lst<TaskInstance> watngLst = getCompleteTaskByState(ExecutonStatus.WAITING_THREAD);
return CollectonUtls.sNotEmpty(watngLst);
}
/**
* prepare for pause
* 1,faled retry task n the preparaton queue , returns to falure drectly
* 2,exsts pause task,complement not completed, pendng submsson of tasks, return to suspenson
* 3,success
*
* @return ExecutonStatus
*/
prvate ExecutonStatus processReadyPause() {
f (hasRetryTaskInStandBy()) {
return ExecutonStatus.FAILURE;
}
Lst<TaskInstance> pauseLst = getCompleteTaskByState(ExecutonStatus.PAUSE);
f (CollectonUtls.sNotEmpty(pauseLst)
|| !sComplementEnd() |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | || readyToSubmtTaskQueue.sze() > 0) {
return ExecutonStatus.PAUSE;
} else {
return ExecutonStatus.SUCCESS;
}
}
/**
* generate the latest process nstance status by the tasks state
*
* @param nstance
* @return process nstance executon status
*/
prvate ExecutonStatus getProcessInstanceState(ProcessInstance nstance) {
ExecutonStatus state = nstance.getState();
f (actveTaskProcessorMaps.sze() > 0 || hasRetryTaskInStandBy()) {
// actve
return runnngState(state);
}
// process falure
f (processFaled()) {
return ExecutonStatus.FAILURE;
}
// watng thread
f (hasWatngThreadTask()) {
return ExecutonStatus.WAITING_THREAD;
}
// pause
f (state == ExecutonStatus.READY_PAUSE) {
return processReadyPause();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | // stop
f (state == ExecutonStatus.READY_STOP) {
Lst<TaskInstance> stopLst = getCompleteTaskByState(ExecutonStatus.STOP);
Lst<TaskInstance> kllLst = getCompleteTaskByState(ExecutonStatus.KILL);
f (CollectonUtls.sNotEmpty(stopLst)
|| CollectonUtls.sNotEmpty(kllLst)
|| !sComplementEnd()) {
return ExecutonStatus.STOP;
} else {
return ExecutonStatus.SUCCESS;
}
}
// success
f (state == ExecutonStatus.RUNNING_EXECUTION) {
Lst<TaskInstance> kllTasks = getCompleteTaskByState(ExecutonStatus.KILL);
f (readyToSubmtTaskQueue.sze() > 0) {
//tasks cu
return ExecutonStatus.RUNNING_EXECUTION;
} else f (CollectonUtls.sNotEmpty(kllTasks)) {
// tasks m
return ExecutonStatus.FAILURE;
} else {
// f the
return ExecutonStatus.SUCCESS;
}
}
return state;
}
/**
* whether complement end |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | *
* @return Boolean whether s complement end
*/
prvate boolean sComplementEnd() {
f (!processInstance.sComplementData()) {
return true;
}
try {
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
Date endTme = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE));
return processInstance.getScheduleTme().equals(endTme);
} catch (Excepton e) {
logger.error("complement end faled ", e);
return false;
}
}
/**
* updateProcessInstance process nstance state
* after each batch of tasks s executed, the status of the process nstance s updated
*/
prvate vod updateProcessInstanceState() {
ProcessInstance nstance = processServce.fndProcessInstanceById(processInstance.getId());
ExecutonStatus state = getProcessInstanceState(nstance);
f (processInstance.getState() != state) {
logger.nfo(
"work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}",
processInstance.getId(), processInstance.getName(),
processInstance.getState(), state,
processInstance.getCommandType());
nstance.setState(state); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | processServce.updateProcessInstance(nstance);
processInstance = nstance;
StateEvent stateEvent = new StateEvent();
stateEvent.setExecutonStatus(processInstance.getState());
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE);
ths.processStateChangeHandler(stateEvent);
}
}
/**
* get task dependency result
*
* @param taskInstance task nstance
* @return DependResult
*/
prvate DependResult getDependResultForTask(TaskInstance taskInstance) {
return sTaskDepsComplete(Long.toStrng(taskInstance.getTaskCode()));
}
/**
* add task to standby lst
*
* @param taskInstance task nstance
*/
prvate vod addTaskToStandByLst(TaskInstance taskInstance) {
logger.nfo("add task to stand by lst: {}", taskInstance.getName());
try {
f (!readyToSubmtTaskQueue.contans(taskInstance)) {
readyToSubmtTaskQueue.put(taskInstance);
}
} catch (Excepton e) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | logger.error("add task nstance to readyToSubmtTaskQueue error, taskName: {}", taskInstance.getName(), e);
}
}
/**
* remove task from stand by lst
*
* @param taskInstance task nstance
*/
prvate vod removeTaskFromStandbyLst(TaskInstance taskInstance) {
logger.nfo("remove task from stand by lst, d: {} name:{}",
taskInstance.getId(),
taskInstance.getName());
try {
readyToSubmtTaskQueue.remove(taskInstance);
} catch (Excepton e) {
logger.error("remove task nstance from readyToSubmtTaskQueue error, task d:{}, Name: {}",
taskInstance.getId(),
taskInstance.getName(), e);
}
}
/**
* has retry task n standby
*
* @return Boolean whether has retry task n standby
*/
prvate boolean hasRetryTaskInStandBy() {
for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) {
f (ter.next().getState().typeIsFalure()) {
return true;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
return false;
}
/**
* close the on gong tasks
*/
prvate vod kllAllTasks() {
logger.nfo("kll called on process nstance d: {}, num: {}", processInstance.getId(),
actveTaskProcessorMaps.sze());
for (nt taskId : actveTaskProcessorMaps.keySet()) {
TaskInstance taskInstance = processServce.fndTaskInstanceById(taskId);
f (taskInstance == null || taskInstance.getState().typeIsFnshed()) {
contnue;
}
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskId);
taskProcessor.acton(TaskActon.STOP);
f (taskProcessor.taskState().typeIsFnshed()) {
StateEvent stateEvent = new StateEvent();
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setExecutonStatus(taskProcessor.taskState());
ths.addStateEvent(stateEvent);
}
}
}
publc boolean workFlowFnsh() {
return ths.processInstance.getState().typeIsFnshed();
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * handlng the lst of tasks to be submtted
*/
prvate vod submtStandByTask() {
try {
nt length = readyToSubmtTaskQueue.sze();
for (nt = 0; < length; ++) {
TaskInstance task = readyToSubmtTaskQueue.peek();
f (task == null) {
contnue;
}
// stop ta
f (task.taskCanRetry()) {
TaskInstance retryTask = processServce.fndTaskInstanceById(task.getId());
f (retryTask != null && retryTask.getState().equals(ExecutonStatus.FORCED_SUCCESS)) {
task.setState(retryTask.getState());
logger.nfo("task: {} has been forced success, put t nto complete task lst and stop retryng", task.getName());
removeTaskFromStandbyLst(task);
completeTaskLst.put(Long.toStrng(task.getTaskCode()), task);
submtPostNode(Long.toStrng(task.getTaskCode()));
contnue;
}
}
//nt var
f (task.sFrstRun()) {
//get pre
Set<Strng> preTask = dag.getPrevousNodes(Long.toStrng(task.getTaskCode()));
getPreVarPool(task, preTask);
}
DependResult dependResult = getDependResultForTask(task);
f (DependResult.SUCCESS == dependResult) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (task.retryTaskIntervalOverTme()) {
nt orgnalId = task.getId();
TaskInstance taskInstance = submtTaskExec(task);
f (taskInstance == null) {
ths.taskFaledSubmt = true;
} else {
removeTaskFromStandbyLst(task);
f (taskInstance.getId() != orgnalId) {
actveTaskProcessorMaps.remove(orgnalId);
}
}
}
} else f (DependResult.FAILED == dependResult) {
// f the
dependFaledTask.put(Long.toStrng(task.getTaskCode()), task);
removeTaskFromStandbyLst(task);
logger.nfo("task {},d:{} depend result : {}", task.getName(), task.getId(), dependResult);
} else f (DependResult.NON_EXEC == dependResult) {
// for som
removeTaskFromStandbyLst(task);
logger.nfo("remove task {},d:{} , because depend result : {}", task.getName(), task.getId(), dependResult);
}
}
} catch (Excepton e) {
logger.error("submt standby task error", e);
}
}
/**
* get recovery task nstance
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @param taskId task d
* @return recovery task nstance
*/
prvate TaskInstance getRecoveryTaskInstance(Strng taskId) {
f (!StrngUtls.sNotEmpty(taskId)) {
return null;
}
try {
Integer ntId = Integer.valueOf(taskId);
TaskInstance task = processServce.fndTaskInstanceById(ntId);
f (task == null) {
logger.error("start node d cannot be found: {}", taskId);
} else {
return task;
}
} catch (Excepton e) {
logger.error("get recovery task nstance faled ", e);
}
return null;
}
/**
* get start task nstance lst
*
* @param cmdParam command param
* @return task nstance lst
*/
prvate Lst<TaskInstance> getStartTaskInstanceLst(Strng cmdParam) {
Lst<TaskInstance> nstanceLst = new ArrayLst<>();
Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam);
f (paramMap != null && paramMap.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | Strng[] dLst = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).splt(Constants.COMMA);
for (Strng nodeId : dLst) {
TaskInstance task = getRecoveryTaskInstance(nodeId);
f (task != null) {
nstanceLst.add(task);
}
}
}
return nstanceLst;
}
/**
* parse "StartNodeNameLst" from cmd param
*
* @param cmdParam command param
* @return start node name lst
*/
prvate Lst<Strng> parseStartNodeName(Strng cmdParam) {
Lst<Strng> startNodeNameLst = new ArrayLst<>();
Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam);
f (paramMap == null) {
return startNodeNameLst;
}
f (paramMap.contansKey(CMD_PARAM_START_NODES)) {
startNodeNameLst = Arrays.asLst(paramMap.get(CMD_PARAM_START_NODES).splt(Constants.COMMA));
}
return startNodeNameLst;
}
/**
* generate start node code lst from parsng command param;
* f "StartNodeIdLst" exsts n command param, return StartNodeIdLst |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,737 | [Bug] [MasterServer] Event handle twice in two thread pool | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
```
[INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION
```
from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS;
grep 870 from the log
```
[INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, 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}
[INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'}
[INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01
[INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''}
[INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION
[INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
[INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS
[INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS
```
### What you expected to happen
Each event is processed only once
### How to reproduce
Create parallel tasks and reduce the master threads.
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6737 | https://github.com/apache/dolphinscheduler/pull/6738 | bdea8d6ae4e35d64686d97f606b1e235f9664dbe | b6824b47419a5abc7ab4279d648417249a74f122 | "2021-11-08T08:11:35Z" | java | "2021-11-08T08:54:58Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | *
* @return recovery node code lst
*/
prvate Lst<Strng> getRecoveryNodeCodeLst() {
Lst<Strng> recoveryNodeCodeLst = new ArrayLst<>();
f (CollectonUtls.sNotEmpty(recoverNodeIdLst)) {
for (TaskInstance task : recoverNodeIdLst) {
recoveryNodeCodeLst.add(Long.toStrng(task.getTaskCode()));
}
}
return recoveryNodeCodeLst;
}
/**
* generate flow dag
*
* @param totalTaskNodeLst total task node lst
* @param startNodeNameLst start node name lst
* @param recoveryNodeCodeLst recovery node code lst
* @param depNodeType depend node type
* @return ProcessDag process dag
* @throws Excepton excepton
*/
publc ProcessDag generateFlowDag(Lst<TaskNode> totalTaskNodeLst,
Lst<Strng> startNodeNameLst,
Lst<Strng> recoveryNodeCodeLst,
TaskDependType depNodeType) throws Excepton {
return DagHelper.generateFlowDag(totalTaskNodeLst, startNodeNameLst, recoveryNodeCodeLst, depNodeType);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,742 | [Bug] [Common] SnowFlakeUtils will generate duplicate id due to clock backward | ### 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 SnowFlakeUtils will generate duplicate id due to clock backward.
This may be caused by we use `System.currentTimeMillis()` to get system time, this method is based on system time, will forward or backward.
https://stackoverflow.com/questions/2978598/will-system-currenttimemillis-always-return-a-value-previous-calls
### What you expected to happen
Generate duplicate Id
### How to reproduce
Hard to reproduce :)
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6742 | https://github.com/apache/dolphinscheduler/pull/6740 | b6824b47419a5abc7ab4279d648417249a74f122 | 0f94577d2613634b268b56b6dbd445bd5528542c | "2021-11-08T12:02:26Z" | java | "2021-11-08T14:26:17Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SnowFlakeUtils.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.common.utils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Objects;
public class SnowFlakeUtils { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,742 | [Bug] [Common] SnowFlakeUtils will generate duplicate id due to clock backward | ### 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 SnowFlakeUtils will generate duplicate id due to clock backward.
This may be caused by we use `System.currentTimeMillis()` to get system time, this method is based on system time, will forward or backward.
https://stackoverflow.com/questions/2978598/will-system-currenttimemillis-always-return-a-value-previous-calls
### What you expected to happen
Generate duplicate Id
### How to reproduce
Hard to reproduce :)
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6742 | https://github.com/apache/dolphinscheduler/pull/6740 | b6824b47419a5abc7ab4279d648417249a74f122 | 0f94577d2613634b268b56b6dbd445bd5528542c | "2021-11-08T12:02:26Z" | java | "2021-11-08T14:26:17Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SnowFlakeUtils.java | private static final long START_TIMESTAMP = 1609430400000L;
private static final long SEQUENCE_BIT = 13;
private static final long MACHINE_BIT = 2;
private static final long MAX_SEQUENCE = ~(-1L << SEQUENCE_BIT);
private static final long MACHINE_LEFT = SEQUENCE_BIT;
private static final long TIMESTAMP_LEFT = SEQUENCE_BIT + MACHINE_BIT;
private final int machineId;
private long sequence = 0L;
private long lastTimestamp = -1L;
private SnowFlakeUtils() throws SnowFlakeException {
try {
this.machineId = Math.abs(Objects.hash(InetAddress.getLocalHost().getHostName())) % 32;
} catch (UnknownHostException e) {
throw new SnowFlakeException(e.getMessage());
}
}
private static SnowFlakeUtils instance = null;
public static synchronized SnowFlakeUtils getInstance() throws SnowFlakeException {
if (instance == null) {
instance = new SnowFlakeUtils();
}
return instance; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,742 | [Bug] [Common] SnowFlakeUtils will generate duplicate id due to clock backward | ### 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 SnowFlakeUtils will generate duplicate id due to clock backward.
This may be caused by we use `System.currentTimeMillis()` to get system time, this method is based on system time, will forward or backward.
https://stackoverflow.com/questions/2978598/will-system-currenttimemillis-always-return-a-value-previous-calls
### What you expected to happen
Generate duplicate Id
### How to reproduce
Hard to reproduce :)
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6742 | https://github.com/apache/dolphinscheduler/pull/6740 | b6824b47419a5abc7ab4279d648417249a74f122 | 0f94577d2613634b268b56b6dbd445bd5528542c | "2021-11-08T12:02:26Z" | java | "2021-11-08T14:26:17Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SnowFlakeUtils.java | }
public synchronized long nextId() throws SnowFlakeException {
long currStmp = nowTimestamp();
if (currStmp < lastTimestamp) {
throw new SnowFlakeException("Clock moved backwards. Refusing to generate id");
}
if (currStmp == lastTimestamp) {
sequence = (sequence + 1) & MAX_SEQUENCE;
if (sequence == 0L) {
currStmp = getNextMill();
}
} else {
sequence = 0L;
}
lastTimestamp = currStmp;
return (currStmp - START_TIMESTAMP) << TIMESTAMP_LEFT
| machineId << MACHINE_LEFT
| sequence;
}
private long getNextMill() {
long mill = nowTimestamp();
while (mill <= lastTimestamp) {
mill = nowTimestamp();
}
return mill;
}
private long nowTimestamp() {
return System.currentTimeMillis();
}
public static class SnowFlakeException extends Exception { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,742 | [Bug] [Common] SnowFlakeUtils will generate duplicate id due to clock backward | ### 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 SnowFlakeUtils will generate duplicate id due to clock backward.
This may be caused by we use `System.currentTimeMillis()` to get system time, this method is based on system time, will forward or backward.
https://stackoverflow.com/questions/2978598/will-system-currenttimemillis-always-return-a-value-previous-calls
### What you expected to happen
Generate duplicate Id
### How to reproduce
Hard to reproduce :)
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6742 | https://github.com/apache/dolphinscheduler/pull/6740 | b6824b47419a5abc7ab4279d648417249a74f122 | 0f94577d2613634b268b56b6dbd445bd5528542c | "2021-11-08T12:02:26Z" | java | "2021-11-08T14:26:17Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SnowFlakeUtils.java | public SnowFlakeException(String message) {
super(message);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.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.alert;
import static org.apache.dolphinscheduler.common.Constants.ALERT_RPC_PORT;
import org.apache.dolphinscheduler.common.thread.Stopper;
import org.apache.dolphinscheduler.dao.AlertDao;
import org.apache.dolphinscheduler.dao.PluginDao;
import org.apache.dolphinscheduler.dao.entity.Alert;
import org.apache.dolphinscheduler.remote.NettyRemotingServer;
import org.apache.dolphinscheduler.remote.command.CommandType;
import org.apache.dolphinscheduler.remote.config.NettyServerConfig;
import java.io.Closeable;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java | import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(value = {
"org.apache.dolphinscheduler.alert",
"org.apache.dolphinscheduler.dao"
})
public class AlertServer implements Closeable {
private static final Logger log = LoggerFactory.getLogger(AlertServer.class);
private final PluginDao pluginDao;
private final AlertDao alertDao;
private final AlertPluginManager alertPluginManager;
private final AlertSender alertSender;
private final AlertRequestProcessor alertRequestProcessor;
private NettyRemotingServer server;
public AlertServer(PluginDao pluginDao, AlertDao alertDao, AlertPluginManager alertPluginManager, AlertSender alertSender, AlertRequestProcessor alertRequestProcessor) {
this.pluginDao = pluginDao;
this.alertDao = alertDao;
this.alertPluginManager = alertPluginManager;
this.alertSender = alertSender;
this.alertRequestProcessor = alertRequestProcessor;
}
public static void main(String[] args) {
SpringApplication.run(AlertServer.class, args);
}
@PostConstruct |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java | public void start() {
log.info("Starting Alert server");
checkTable();
startServer();
if (alertPluginManager.size() == 0) {
log.warn("No alert plugin, alert sender will exit.");
return;
}
Executors.newScheduledThreadPool(1)
.scheduleAtFixedRate(new Sender(), 5, 5, TimeUnit.SECONDS);
}
@Override
@PreDestroy
public void close() {
server.close();
}
private void checkTable() {
if (!pluginDao.checkPluginDefineTableExist()) {
log.error("Plugin Define Table t_ds_plugin_define Not Exist . Please Create it First !");
System.exit(1);
}
}
private void startServer() {
NettyServerConfig serverConfig = new NettyServerConfig();
serverConfig.setListenPort(ALERT_RPC_PORT);
server = new NettyRemotingServer(serverConfig);
server.registerProcessor(CommandType.ALERT_SEND_REQUEST, alertRequestProcessor);
server.start();
}
final class Sender implements Runnable { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java | @Override
public void run() {
if (!Stopper.isRunning()) {
return;
}
try {
final List<Alert> alerts = alertDao.listPendingAlerts();
alertSender.send(alerts);
} catch (Exception e) {
log.error("Failed to send alert", e);
}
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | 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.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
@SpringBootApplication |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java | @ServletComponentScan
@ComponentScan(value = "org.apache.dolphinscheduler",
excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.apache.dolphinscheduler.server.*"))
public class ApiApplicationServer extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(ApiApplicationServer.class, args);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.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.log;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.remote.NettyRemotingServer;
import org.apache.dolphinscheduler.remote.command.CommandType;
import org.apache.dolphinscheduler.remote.config.NettyServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* logger server
*/
public class LoggerServer { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.java | private static final Logger logger = LoggerFactory.getLogger(LoggerServer.class);
/**
* netty server
*/
private final NettyRemotingServer server;
/**
* netty server config
*/
private final NettyServerConfig serverConfig;
/**
* loggger request processor
*/
private final LoggerRequestProcessor requestProcessor;
public LoggerServer(){
this.serverConfig = new NettyServerConfig();
this.serverConfig.setListenPort(Constants.RPC_PORT);
this.server = new NettyRemotingServer(serverConfig);
this.requestProcessor = new LoggerRequestProcessor();
this.server.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, requestProcessor, requestProcessor.getExecutor());
this.server.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor());
this.server.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor());
this.server.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.java | /**
* main launches the server from the command line.
* @param args arguments
*/
public static void main(String[] args) {
final LoggerServer server = new LoggerServer();
server.start();
}
/**
* server start
*/
public void start() {
this.server.start();
logger.info("logger server started, listening on port : {}" , Constants.RPC_PORT);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
LoggerServer.this.stop();
}
});
}
/**
* stop
*/
public void stop() {
this.server.close();
logger.info("logger server shut down");
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/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; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | import org.apache.dolphinscheduler.common.Constants;
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.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.master.processor.StateEventProcessor;
import org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor;
import org.apache.dolphinscheduler.server.master.processor.TaskKillResponseProcessor;
import org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor;
import org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient;
import org.apache.dolphinscheduler.server.master.runner.EventExecuteService;
import org.apache.dolphinscheduler.server.master.runner.MasterSchedulerService;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
import org.apache.dolphinscheduler.service.quartz.QuartzExecutors;
import javax.annotation.PostConstruct;
import org.quartz.SchedulerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* master server
*/
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
"org.apache.dolphinscheduler.server.worker.*",
"org.apache.dolphinscheduler.server.monitor.*",
"org.apache.dolphinscheduler.server.log.*"
})
})
@EnableTransactionManagement
public class MasterServer implements IStoppable {
/**
* logger of MasterServer
*/
private static final Logger logger = LoggerFactory.getLogger(MasterServer.class);
/**
* master config
*/
@Autowired |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | private MasterConfig masterConfig;
/**
* spring application context
* only use it for initialization
*/
@Autowired
private SpringApplicationContext springApplicationContext;
/**
* netty remote server
*/
private NettyRemotingServer nettyRemotingServer;
/**
* zk master client
*/
@Autowired
private MasterRegistryClient masterRegistryClient;
/**
* scheduler service
*/
@Autowired
private MasterSchedulerService masterSchedulerService;
@Autowired
private EventExecuteService eventExecuteService;
/**
* master server startup, not use web service
*
* @param args arguments
*/
public static void main(String[] args) {
Thread.currentThread().setName(Constants.THREAD_NAME_MASTER_SERVER); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | new SpringApplicationBuilder(MasterServer.class).web(WebApplicationType.NONE).run(args);
}
/**
* run master server
*/
@PostConstruct
public void run() {
NettyServerConfig serverConfig = new NettyServerConfig();
serverConfig.setListenPort(masterConfig.getListenPort());
this.nettyRemotingServer = new NettyRemotingServer(serverConfig);
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE, new TaskResponseProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_ACK, new TaskAckProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_RESPONSE, new TaskKillResponseProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.STATE_EVENT_REQUEST, new StateEventProcessor());
this.nettyRemotingServer.start();
this.masterRegistryClient.init();
this.masterRegistryClient.start();
this.masterRegistryClient.setRegistryStoppable(this);
this.eventExecuteService.init();
this.eventExecuteService.start();
this.masterSchedulerService.init();
this.masterSchedulerService.start();
try {
logger.info("start Quartz server...");
QuartzExecutors.getInstance().start(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | } catch (Exception e) {
try {
QuartzExecutors.getInstance().shutdown();
} catch (SchedulerException e1) {
logger.error("QuartzExecutors shutdown failed : " + e1.getMessage(), e1);
}
logger.error("start Quartz failed", e);
}
/**
* register hooks, which are called before the process exits
*/
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
if (Stopper.isRunning()) {
close("shutdownHook");
}
}));
}
/**
* gracefully close
*
* @param cause close cause
*/
public void close(String cause) {
try {
if (Stopper.isStopped()) {
return;
}
logger.info("master server is stopping ..., cause : {}", cause); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java | Stopper.stop();
try {
Thread.sleep(3000L);
} catch (Exception e) {
logger.warn("thread sleep exception ", e);
}
this.masterSchedulerService.close();
this.nettyRemotingServer.close();
this.masterRegistryClient.closeRegistry();
try {
QuartzExecutors.getInstance().shutdown();
logger.info("Quartz service stopped");
} catch (Exception e) {
logger.warn("Quartz service stopped exception:{}", e.getMessage());
}
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 | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/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 | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java | 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.worker.config.WorkerConfig;
import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager;
import org.apache.dolphinscheduler.server.worker.processor.DBTaskAckProcessor;
import org.apache.dolphinscheduler.server.worker.processor.DBTaskResponseProcessor;
import org.apache.dolphinscheduler.server.worker.processor.HostUpdateProcessor;
import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor;
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 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.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* worker server
*/
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = {
@ComponentScan.Filter(type = FilterType.REGEX, pattern = { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java | "org.apache.dolphinscheduler.server.master.*",
"org.apache.dolphinscheduler.server.monitor.*",
"org.apache.dolphinscheduler.server.log.*"
})
})
@EnableTransactionManagement
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
*/
private AlertClientService alertClientService; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java | @Autowired
private RetryReportTaskStatusThread retryReportTaskStatusThread;
@Autowired
private WorkerManagerThread workerManagerThread;
/**
* worker registry
*/
@Autowired
private WorkerRegistryClient workerRegistryClient;
@Autowired
private TaskPluginManager taskPluginManager;
/**
* worker server startup, not use web service
*
* @param args arguments
*/
public static void main(String[] args) {
Thread.currentThread().setName(Constants.THREAD_NAME_WORKER_SERVER);
new SpringApplicationBuilder(WorkerServer.class).web(WebApplicationType.NONE).run(args);
}
/**
* worker server run
*/
@PostConstruct
public void run() {
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(), Constants.ALERT_RPC_PORT);
NettyServerConfig serverConfig = new NettyServerConfig();
serverConfig.setListenPort(workerConfig.getListenPort()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java | this.nettyRemotingServer = new NettyRemotingServer(serverConfig);
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor(alertClientService, taskPluginManager));
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, new TaskKillProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_ACK, new DBTaskAckProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_RESPONSE, new DBTaskResponseProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, new HostUpdateProcessor());
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);
}
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");
}
}));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java | 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();
this.workerRegistryClient.unRegistry();
this.alertClientService.close();
this.springApplicationContext.close();
} catch (Exception e) {
logger.error("worker server stop exception ", e);
}
}
@Override
public void stop(String cause) {
close(cause);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.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;
import org.apache.dolphinscheduler.alert.AlertServer;
import org.apache.dolphinscheduler.api.ApiApplicationServer;
import org.apache.dolphinscheduler.server.master.MasterServer;
import org.apache.dolphinscheduler.server.worker.WorkerServer;
import org.apache.curator.test.TestingServer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,792 | [Bug] [alert] NettyRemotingServer bind 50052 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
NettyRemotingServer bind fail bind(..) failed: Address already in use, exit
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
--dev
### What you expected to happen
--
### How to reproduce
--
### Anything else
--
### 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/6792 | https://github.com/apache/dolphinscheduler/pull/6815 | da2a04494723a02b03f05056eb5f164eae4ee705 | e36d18b58890eb18a64ecc2a5181b37125a070f8 | "2021-11-11T07:24:58Z" | java | "2021-11-12T02:51:11Z" | dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java | public class StandaloneServer {
public static void main(String[] args) throws Exception {
final TestingServer server = new TestingServer(true);
System.setProperty("registry.servers", server.getConnectString());
new SpringApplicationBuilder(
ApiApplicationServer.class,
MasterServer.class,
WorkerServer.class,
AlertServer.class,
PythonGatewayServer.class
).profiles("h2").run(args);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.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.registry;
import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS;
import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_NODE;
import static org.apache.dolphinscheduler.common.Constants.SLEEP_TIME_MILLIS;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.IStoppable;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.enums.NodeType;
import org.apache.dolphinscheduler.common.enums.StateEvent;
import org.apache.dolphinscheduler.common.enums.StateEventType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.thread.ThreadUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.registry.api.ConnectionState;
import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
import org.apache.dolphinscheduler.server.builder.TaskExecutionContextBuilder;
import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager;
import org.apache.dolphinscheduler.server.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread;
import org.apache.dolphinscheduler.server.registry.HeartBeatTask;
import org.apache.dolphinscheduler.server.utils.ProcessUtils;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.service.registry.RegistryClient;
import org.apache.commons.lang.StringUtils;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.google.common.collect.Sets;
/**
* zookeeper master client
* <p>
* single instance
*/
@Component |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | public class MasterRegistryClient {
/**
* logger
*/
private static final Logger logger = LoggerFactory.getLogger(MasterRegistryClient.class);
/**
* process service
*/
@Autowired
private ProcessService processService;
@Autowired
private RegistryClient registryClient;
/**
* master config
*/
@Autowired
private MasterConfig masterConfig;
/**
* heartbeat executor
*/
private ScheduledExecutorService heartBeatExecutor;
@Autowired
private ProcessInstanceExecCacheManager processInstanceExecCacheManager;
/**
* master startup time, ms
*/
private long startupTime;
private String localNodePath; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | public void init() {
this.startupTime = System.currentTimeMillis();
this.heartBeatExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("HeartBeatExecutor"));
}
public void start() {
String nodeLock = Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS;
try {
registryClient.getLock(nodeLock);
registry();
String registryPath = getMasterPath();
registryClient.handleDeadServer(Collections.singleton(registryPath), NodeType.MASTER, Constants.DELETE_OP);
while (!registryClient.checkNodeExists(NetUtils.getHost(), NodeType.MASTER)) {
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
}
if (registryClient.getActiveMasterNum() == 1) {
removeNodePath(null, NodeType.MASTER, true);
removeNodePath(null, NodeType.WORKER, true);
}
registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_NODE, new MasterRegistryDataListener());
} catch (Exception e) {
logger.error("master start up exception", e);
} finally {
registryClient.releaseLock(nodeLock);
}
}
public void setRegistryStoppable(IStoppable stoppable) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | registryClient.setStoppable(stoppable);
}
public void closeRegistry() {
deregister();
}
/**
* remove zookeeper node path
*
* @param path zookeeper node path
* @param nodeType zookeeper node type
* @param failover is failover
*/
public void removeNodePath(String path, NodeType nodeType, boolean failover) {
logger.info("{} node deleted : {}", nodeType, path);
String failoverPath = getFailoverLockPath(nodeType);
try {
registryClient.getLock(failoverPath);
String serverHost = null;
if (!StringUtils.isEmpty(path)) {
serverHost = registryClient.getHostByEventDataPath(path);
if (StringUtils.isEmpty(serverHost)) {
logger.error("server down error: unknown path: {}", path);
return;
}
registryClient.handleDeadServer(Collections.singleton(path), nodeType, Constants.ADD_OP);
}
if (failover) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | failoverServerWhenDown(serverHost, nodeType);
}
} catch (Exception e) {
logger.error("{} server failover failed.", nodeType);
logger.error("failover exception ", e);
} finally {
registryClient.releaseLock(failoverPath);
}
}
/**
* failover server when server down
*
* @param serverHost server host
* @param nodeType zookeeper node type
*/
private void failoverServerWhenDown(String serverHost, NodeType nodeType) {
switch (nodeType) {
case MASTER:
failoverMaster(serverHost);
break;
case WORKER:
failoverWorker(serverHost, true, true);
break;
default:
break;
}
}
/**
* get failover lock path
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | * @param nodeType zookeeper node type
* @return fail over lock path
*/
private String getFailoverLockPath(NodeType nodeType) {
switch (nodeType) {
case MASTER:
return Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS;
case WORKER:
return Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS;
default:
return "";
}
}
/**
* task needs failover if task start before worker starts
*
* @param taskInstance task instance
* @return true if task instance need fail over
*/
private boolean checkTaskInstanceNeedFailover(TaskInstance taskInstance) {
boolean taskNeedFailover = true;
if (taskInstance.getHost() == null) {
return false;
}
if (registryClient.checkNodeExists(taskInstance.getHost(), NodeType.WORKER)) {
if (checkTaskAfterWorkerStart(taskInstance)) {
taskNeedFailover = false; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | }
}
return taskNeedFailover;
}
/**
* check task start after the worker server starts.
*
* @param taskInstance task instance
* @return true if task instance start time after worker server start date
*/
private boolean checkTaskAfterWorkerStart(TaskInstance taskInstance) {
if (StringUtils.isEmpty(taskInstance.getHost())) {
return false;
}
Date workerServerStartDate = null;
List<Server> workerServers = registryClient.getServerList(NodeType.WORKER);
for (Server workerServer : workerServers) {
if (taskInstance.getHost().equals(workerServer.getHost() + Constants.COLON + workerServer.getPort())) {
workerServerStartDate = workerServer.getCreateTime();
break;
}
}
if (workerServerStartDate != null) {
return taskInstance.getStartTime().after(workerServerStartDate);
}
return false;
}
/**
* failover worker tasks
* <p> |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | * 1. kill yarn job if there are yarn jobs in tasks.
* 2. change task state from running to need failover.
* 3. failover all tasks when workerHost is null
*
* @param workerHost worker host
* @param needCheckWorkerAlive need check worker alive
* @param checkOwner need check process instance owner
*/
private void failoverWorker(String workerHost, boolean needCheckWorkerAlive, boolean checkOwner) {
logger.info("start worker[{}] failover ...", workerHost);
List<TaskInstance> needFailoverTaskInstanceList = processService.queryNeedFailoverTaskInstances(workerHost);
for (TaskInstance taskInstance : needFailoverTaskInstanceList) {
if (needCheckWorkerAlive) {
if (!checkTaskInstanceNeedFailover(taskInstance)) {
continue;
}
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(taskInstance.getProcessInstanceId());
if (workerHost == null
|| !checkOwner
|| processInstance.getHost().equalsIgnoreCase(getLocalAddress())) {
if (processInstance == null) {
logger.error("failover error, the process {} of task {} do not exists.",
taskInstance.getProcessInstanceId(), taskInstance.getId());
continue;
}
taskInstance.setProcessInstance(processInstance);
TaskExecutionContext taskExecutionContext = TaskExecutionContextBuilder.get()
.buildTaskInstanceRelatedInfo(taskInstance) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | .buildProcessInstanceRelatedInfo(processInstance)
.create();
ProcessUtils.killYarnJob(taskExecutionContext);
taskInstance.setState(ExecutionStatus.NEED_FAULT_TOLERANCE);
processService.saveTaskInstance(taskInstance);
if (!processInstanceExecCacheManager.contains(processInstance.getId())) {
return;
}
WorkflowExecuteThread workflowExecuteThreadNotify = processInstanceExecCacheManager.getByProcessInstanceId(processInstance.getId());
StateEvent stateEvent = new StateEvent();
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
stateEvent.setProcessInstanceId(processInstance.getId());
stateEvent.setExecutionStatus(taskInstance.getState());
workflowExecuteThreadNotify.addStateEvent(stateEvent);
}
}
logger.info("end worker[{}] failover ...", workerHost);
}
/**
* failover master tasks
*
* @param masterHost master host
*/
private void failoverMaster(String masterHost) {
logger.info("start master failover ...");
List<ProcessInstance> needFailoverProcessInstanceList = processService.queryNeedFailoverProcessInstances(masterHost);
logger.info("failover process list size:{} ", needFailoverProcessInstanceList.size()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | for (ProcessInstance processInstance : needFailoverProcessInstanceList) {
logger.info("failover process instance id: {} host:{}", processInstance.getId(), processInstance.getHost());
if (Constants.NULL.equals(processInstance.getHost())) {
continue;
}
processService.processNeedFailoverProcessInstances(processInstance);
}
failoverWorker(masterHost, true, false);
logger.info("master failover end");
}
/**
* registry
*/
public void registry() {
String address = NetUtils.getAddr(masterConfig.getListenPort());
localNodePath = getMasterPath();
int masterHeartbeatInterval = masterConfig.getMasterHeartbeatInterval();
HeartBeatTask heartBeatTask = new HeartBeatTask(startupTime,
masterConfig.getMasterMaxCpuloadAvg(),
masterConfig.getMasterReservedMemory(),
Sets.newHashSet(getMasterPath()),
Constants.MASTER_TYPE,
registryClient);
registryClient.persistEphemeral(localNodePath, heartBeatTask.getHeartBeatInfo());
registryClient.addConnectionStateListener(newState -> {
if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) {
registryClient.persistEphemeral(localNodePath, "");
}
});
this.heartBeatExecutor.scheduleAtFixedRate(heartBeatTask, masterHeartbeatInterval, masterHeartbeatInterval, TimeUnit.SECONDS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,771 | [Bug] [MasterServer] failover worker interrupt | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
branch: 2.0
When worker down and start again, a lot of process instance and task instance is not run by fault tolerance, but still keep running state.
And I found that when Master run failoverWorker, it's interrupted.
```
grep failover logs/dolphinscheduler-master.2021-11-10_14.*
[root@ds1 apache-dolphinscheduler-2.0.1-alpha-SNAPSHOT-bin]# grep failover logs/dolphinscheduler-master.2021-11-10_14.*
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.887 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[333] - start master failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.948 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[337] - failover process list size:0
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.949 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.955 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[348] - master failover end
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.958 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:33:47.960 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[324] - end worker[null] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log:[INFO] 2021-11-10 14:49:06.004 org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[281] - start worker[172.28.230.24:1234] failover ...
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverWorker(MasterRegistryClient.java:307)
logs/dolphinscheduler-master.2021-11-10_14.0.log: at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverServerWhenDown(MasterRegistryClient.java:196)
```
I found a return if processInstanceExecMaps doesn't contain `processInstance.getId()`, it should be continue.
### What you expected to happen
failover normally.
### How to reproduce
run a lot of tasks and restart the worker.
### Anything else
_No response_
### 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/6771 | https://github.com/apache/dolphinscheduler/pull/6801 | d168a3cdf7cec9689dc8ae439c4a02ab10922287 | 5741c758b3521885e4ea11fdcb3c66d275537739 | "2021-11-10T08:05:17Z" | java | "2021-11-12T06:19:57Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java | logger.info("master node : {} registry to ZK successfully with heartBeatInterval : {}s", address, masterHeartbeatInterval);
}
public void deregister() {
try {
String address = getLocalAddress();
String localNodePath = getMasterPath();
registryClient.remove(localNodePath);
logger.info("master node : {} unRegistry to register center.", address);
heartBeatExecutor.shutdown();
logger.info("heartbeat executor shutdown");
registryClient.close();
} catch (Exception e) {
logger.error("remove registry path exception ", e);
}
}
/**
* get master path
*/
public String getMasterPath() {
String address = getLocalAddress();
return REGISTRY_DOLPHINSCHEDULER_MASTERS + "/" + address;
}
/**
* get local address
*/
private String getLocalAddress() {
return NetUtils.getAddr(masterConfig.getListenPort());
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.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;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ExecutorService;
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.service.QueueService;
import org.apache.dolphinscheduler.api.service.TaskDefinitionService;
import org.apache.dolphinscheduler.api.service.TenantService;
import org.apache.dolphinscheduler.api.service.UsersService;
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; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.RunMode;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.Queue;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
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.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import py4j.GatewayServer;
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
"org.apache.dolphinscheduler.server.master.*",
"org.apache.dolphinscheduler.server.worker.*",
"org.apache.dolphinscheduler.server.monitor.*",
"org.apache.dolphinscheduler.server.log.*"
})
})
public class PythonGatewayServer extends SpringBootServletInitializer {
private static final Logger LOGGER = LoggerFactory.getLogger(PythonGatewayServer.class);
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private ProjectService projectService;
@Autowired
private TenantService tenantService;
@Autowired
private ExecutorService executorService;
@Autowired
private ProcessDefinitionService processDefinitionService; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | @Autowired
private TaskDefinitionService taskDefinitionService;
@Autowired
private UsersService usersService;
@Autowired
private QueueService queueService;
@Autowired
private ProjectMapper projectMapper;
@Autowired
private TaskDefinitionMapper taskDefinitionMapper;
private final User dummyAdminUser = new User() {
{
setId(Integer.MAX_VALUE);
setUserName("dummyUser");
setUserType(UserType.ADMIN_USER);
}
};
private final Queue queuePythonGateway = new Queue() {
{
setId(Integer.MAX_VALUE);
setQueueName("queuePythonGateway");
}
};
public String ping() {
return "PONG";
}
public Map<String, Object> genTaskCodeList(Integer genNum) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | return taskDefinitionService.genTaskCodeList(genNum);
}
public Map<String, Long> getCodeAndVersion(String projectName, String taskName) throws SnowFlakeUtils.SnowFlakeException {
Project project = projectMapper.queryByName(projectName);
Map<String, Long> result = new HashMap<>();
if (project == null) {
result.put("code", SnowFlakeUtils.getInstance().nextId());
result.put("version", 0L);
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByName(project.getCode(), taskName);
if (taskDefinition == null) {
result.put("code", SnowFlakeUtils.getInstance().nextId());
result.put("version", 0L);
} else {
result.put("code", taskDefinition.getCode());
result.put("version", (long) taskDefinition.getVersion());
}
return result;
}
/**
* create or update process definition.
* If process definition do not exists in Project=`projectCode` would create a new one
* If process definition already exists in Project=`projectCode` would update it
* All requests
* <p>
*
* @param name process definition name
* @param description description |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | * @param globalParams global params
* @param locations locations for nodes
* @param timeout timeout
* @param tenantCode tenantCode
* @param taskRelationJson relation json for nodes
* @param taskDefinitionJson taskDefinitionJson
* @return create result code
*/
public Long createOrUpdateProcessDefinition(String userName,
String projectName,
String name,
String description,
String globalParams,
String locations,
int timeout,
String tenantCode,
String taskRelationJson,
String taskDefinitionJson,
ProcessExecutionTypeEnum executionType) {
User user = usersService.queryUser(userName);
Project project = (Project) projectService.queryByName(user, projectName).get(Constants.DATA_LIST);
long projectCode = project.getCode();
Map<String, Object> verifyProcessDefinitionExists = processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
Status verifyStatus = (Status) verifyProcessDefinitionExists.get(Constants.STATUS);
if (verifyStatus == Status.PROCESS_DEFINITION_NAME_EXIST) {
ProcessDefinition processDefinition = processDefinitionMapper.queryByDefineName(projectCode, name);
long processDefinitionCode = processDefinition.getCode();
processDefinitionService.releaseProcessDefinition(user, projectCode, processDefinitionCode, ReleaseState.OFFLINE); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | Map<String, Object> result = processDefinitionService.updateProcessDefinition(user, projectCode, name, processDefinitionCode, description, globalParams,
locations, timeout, tenantCode, taskRelationJson, taskDefinitionJson,executionType);
return processDefinitionCode;
} else if (verifyStatus == Status.SUCCESS) {
Map<String, Object> result = processDefinitionService.createProcessDefinition(user, projectCode, name, description, globalParams,
locations, timeout, tenantCode, taskRelationJson, taskDefinitionJson,executionType);
ProcessDefinition processDefinition = (ProcessDefinition) result.get(Constants.DATA_LIST);
return processDefinition.getCode();
} else {
String msg = "Verify process definition exists status is invalid, neither SUCCESS or PROCESS_DEFINITION_NAME_EXIST.";
LOGGER.error(msg);
throw new RuntimeException(msg);
}
}
public void execProcessInstance(String userName,
String projectName,
String processDefinitionName,
String cronTime,
String workerGroup,
Integer timeout
) {
User user = usersService.queryUser(userName);
Project project = projectMapper.queryByName(projectName);
ProcessDefinition processDefinition = processDefinitionMapper.queryByDefineName(project.getCode(), processDefinitionName);
FailureStrategy failureStrategy = FailureStrategy.CONTINUE;
TaskDependType taskDependType = TaskDependType.TASK_POST;
WarningType warningType = WarningType.NONE;
RunMode runMode = RunMode.RUN_MODE_SERIAL; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | Priority priority = Priority.MEDIUM;
int warningGroupId = 0;
Long environmentCode = -1L;
Map<String, String> startParams = null;
Integer expectedParallelismNumber = null;
String startNodeList = null;
processDefinitionService.releaseProcessDefinition(user, project.getCode(), processDefinition.getCode(), ReleaseState.ONLINE);
executorService.execProcessInstance(user,
project.getCode(),
processDefinition.getCode(),
cronTime,
null,
failureStrategy,
startNodeList,
taskDependType,
warningType,
warningGroupId,
runMode,
priority,
workerGroup,
environmentCode,
timeout,
startParams,
expectedParallelismNumber,
0
);
}
public Map<String, Object> createProject(String userName, String name, String desc) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | User user = usersService.queryUser(userName);
return projectService.createProject(user, name, desc);
}
public Map<String, Object> createQueue(String name, String queueName) {
Result<Object> verifyQueueExists = queueService.verifyQueue(name, queueName);
if (verifyQueueExists.getCode() == 0) {
return queueService.createQueue(dummyAdminUser, name, queueName);
} else {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, Status.SUCCESS);
result.put(Constants.MSG, Status.SUCCESS.getMsg());
return result;
}
}
public Map<String, Object> createTenant(String tenantCode, String desc, String queueName) throws Exception {
if (tenantService.checkTenantExists(tenantCode)) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, Status.SUCCESS);
result.put(Constants.MSG, Status.SUCCESS.getMsg());
return result;
} else {
Result<Object> verifyQueueExists = queueService.verifyQueue(queueName, queueName);
if (verifyQueueExists.getCode() == 0) {
queueService.createQueue(dummyAdminUser, queueName, queueName);
}
Map<String, Object> result = queueService.queryQueueName(queueName);
List<Queue> queueList = (List<Queue>) result.get(Constants.DATA_LIST); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,838 | [Feature][python] Add parameter schedule to process definition | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Python API `ProcessDefinition` do not support schedule for now, we should add this to it, and set workflow schedule parameter. https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-python/pydolphinscheduler/examples/tutorial.py
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a 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/6838 | https://github.com/apache/dolphinscheduler/pull/6664 | 089f73ebe4b6fcdb8c02b9098ebe86a8de183ace | e76cf77040ae558461c54730c27eb0fbe28bc54f | "2021-11-13T07:04:12Z" | java | "2021-11-13T09:21:40Z" | dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java | Queue queue = queueList.get(0);
return tenantService.createTenant(dummyAdminUser, tenantCode, queue.getId(), desc);
}
}
public void createUser(String userName,
String userPassword,
String email,
String phone,
String tenantCode,
String queue,
int state) {
User user = usersService.queryUser(userName);
if (Objects.isNull(user)) {
Map<String, Object> tenantResult = tenantService.queryByTenantCode(tenantCode);
Tenant tenant = (Tenant) tenantResult.get(Constants.DATA_LIST);
usersService.createUser(userName, userPassword, email, tenant.getId(), phone, queue, state);
}
}
@PostConstruct
public void run() {
GatewayServer server = new GatewayServer(this);
GatewayServer.turnLoggingOn();
server.start();
}
public static void main(String[] args) {
SpringApplication.run(PythonGatewayServer.class, args);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | /*
* Lcensed to the Apache Software Foundaton (ASF) under one or more
* contrbutor lcense agreements. See the NOTICE fle dstrbuted wth
* ths work for addtonal nformaton regardng copyrght ownershp.
* The ASF lcenses ths fle to You under the Apache Lcense, Verson 2.0
* (the "Lcense"); you may not use ths fle except n complance wth
* the Lcense. You may obtan a copy of the Lcense at
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * http://www.apache.org/lcenses/LICENSE-2.0
*
* Unless requred by applcable law or agreed to n wrtng, software
* dstrbuted under the Lcense s dstrbuted on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ether express or mpled.
* See the Lcense for the specfc language governng permssons and
* lmtatons under the Lcense.
*/
package org.apache.dolphnscheduler.server.master.runner;
mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE;
mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE;
mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING;
mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING;
mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_START_NODES;
mport statc org.apache.dolphnscheduler.common.Constants.DEFAULT_WORKER_GROUP;
mport org.apache.dolphnscheduler.common.Constants;
mport org.apache.dolphnscheduler.common.enums.CommandType;
mport org.apache.dolphnscheduler.common.enums.DependResult;
mport org.apache.dolphnscheduler.common.enums.Drect;
mport org.apache.dolphnscheduler.common.enums.ExecutonStatus;
mport org.apache.dolphnscheduler.common.enums.FalureStrategy;
mport org.apache.dolphnscheduler.common.enums.Flag;
mport org.apache.dolphnscheduler.common.enums.Prorty;
mport org.apache.dolphnscheduler.common.enums.StateEvent;
mport org.apache.dolphnscheduler.common.enums.StateEventType;
mport org.apache.dolphnscheduler.common.enums.TaskDependType;
mport org.apache.dolphnscheduler.common.enums.TaskTmeoutStrategy;
mport org.apache.dolphnscheduler.common.enums.TmeoutFlag;
mport org.apache.dolphnscheduler.common.graph.DAG;
mport org.apache.dolphnscheduler.common.model.TaskNode; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | mport org.apache.dolphnscheduler.common.model.TaskNodeRelaton;
mport org.apache.dolphnscheduler.common.process.ProcessDag;
mport org.apache.dolphnscheduler.common.process.Property;
mport org.apache.dolphnscheduler.common.utls.DateUtls;
mport org.apache.dolphnscheduler.common.utls.JSONUtls;
mport org.apache.dolphnscheduler.common.utls.NetUtls;
mport org.apache.dolphnscheduler.common.utls.ParameterUtls;
mport org.apache.dolphnscheduler.dao.entty.Command;
mport org.apache.dolphnscheduler.dao.entty.Envronment;
mport org.apache.dolphnscheduler.dao.entty.ProcessDefnton;
mport org.apache.dolphnscheduler.dao.entty.ProcessInstance;
mport org.apache.dolphnscheduler.dao.entty.ProjectUser;
mport org.apache.dolphnscheduler.dao.entty.Schedule;
mport org.apache.dolphnscheduler.dao.entty.TaskDefnton;
mport org.apache.dolphnscheduler.dao.entty.TaskInstance;
mport org.apache.dolphnscheduler.dao.utls.DagHelper;
mport org.apache.dolphnscheduler.remote.command.HostUpdateCommand;
mport org.apache.dolphnscheduler.remote.utls.Host;
mport org.apache.dolphnscheduler.server.master.confg.MasterConfg;
mport org.apache.dolphnscheduler.server.master.dspatch.executor.NettyExecutorManager;
mport org.apache.dolphnscheduler.server.master.runner.task.ITaskProcessor;
mport org.apache.dolphnscheduler.server.master.runner.task.TaskActon;
mport org.apache.dolphnscheduler.server.master.runner.task.TaskProcessorFactory;
mport org.apache.dolphnscheduler.servce.alert.ProcessAlertManager;
mport org.apache.dolphnscheduler.servce.process.ProcessServce;
mport org.apache.dolphnscheduler.servce.quartz.cron.CronUtls;
mport org.apache.dolphnscheduler.servce.queue.PeerTaskInstancePrortyQueue;
mport org.apache.commons.collectons.CollectonUtls;
mport org.apache.commons.lang.StrngUtls;
mport java.utl.ArrayLst; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | mport java.utl.Arrays;
mport java.utl.Collecton;
mport java.utl.Date;
mport java.utl.HashMap;
mport java.utl.Iterator;
mport java.utl.Lst;
mport java.utl.Map;
mport java.utl.Objects;
mport java.utl.Set;
mport java.utl.concurrent.ConcurrentHashMap;
mport java.utl.concurrent.ConcurrentLnkedQueue;
mport org.slf4j.Logger;
mport org.slf4j.LoggerFactory;
mport com.google.common.collect.HashBasedTable;
mport com.google.common.collect.Lsts;
mport com.google.common.collect.Table;
/**
* master exec thread,splt dag
*/
publc class WorkflowExecuteThread mplements Runnable {
/**
* logger of WorkflowExecuteThread
*/
prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteThread.class);
/**
* runng TaskNode
*/
prvate fnal Map<Integer, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>();
/**
* process nstance |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | */
prvate ProcessInstance processInstance;
/**
* submt falure nodes
*/
prvate boolean taskFaledSubmt = false;
/**
* recover node d lst
*/
prvate Lst<TaskInstance> recoverNodeIdLst = new ArrayLst<>();
/**
* error task lst
*/
prvate Map<Strng, TaskInstance> errorTaskLst = new ConcurrentHashMap<>();
/**
* complete task lst
*/
prvate Map<Strng, TaskInstance> completeTaskLst = new ConcurrentHashMap<>();
/**
* ready to submt task queue
*/
prvate PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue();
/**
* depend faled task map
*/
prvate Map<Strng, TaskInstance> dependFaledTask = new ConcurrentHashMap<>();
/**
* forbdden task map
*/
prvate Map<Strng, TaskNode> forbddenTaskLst = new ConcurrentHashMap<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | /**
* skp task map
*/
prvate Map<Strng, TaskNode> skpTaskNodeLst = new ConcurrentHashMap<>();
/**
* recover tolerance fault task lst
*/
prvate Lst<TaskInstance> recoverToleranceFaultTaskLst = new ArrayLst<>();
/**
* alert manager
*/
prvate ProcessAlertManager processAlertManager;
/**
* the object of DAG
*/
prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag;
/**
* process servce
*/
prvate ProcessServce processServce;
/**
* master confg
*/
prvate MasterConfg masterConfg;
/**
*
*/
prvate NettyExecutorManager nettyExecutorManager;
prvate ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>();
prvate Lst<Date> complementLstDate = Lsts.newLnkedLst(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate Table<Integer, Long, TaskInstance> taskInstanceHashMap = HashBasedTable.create();
prvate ProcessDefnton processDefnton;
prvate Strng key;
prvate ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst;
/**
* start flag, true: start nodes submt completely
*
*/
prvate boolean sStart = false;
/**
* constructor of WorkflowExecuteThread
*
* @param processInstance processInstance
* @param processServce processServce
* @param nettyExecutorManager nettyExecutorManager
* @param taskTmeoutCheckLst
*/
publc WorkflowExecuteThread(ProcessInstance processInstance
, ProcessServce processServce
, NettyExecutorManager nettyExecutorManager
, ProcessAlertManager processAlertManager
, MasterConfg masterConfg
, ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst) {
ths.processServce = processServce;
ths.processInstance = processInstance;
ths.masterConfg = masterConfg;
ths.nettyExecutorManager = nettyExecutorManager;
ths.processAlertManager = processAlertManager;
ths.taskTmeoutCheckLst = taskTmeoutCheckLst;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | @Overrde
publc vod run() {
try {
f (!ths.sStart()) {
startProcess();
} else {
handleEvents();
}
} catch (Excepton e) {
logger.error("handler error:", e);
}
}
/**
* the process start nodes are submtted completely.
* @return
*/
publc boolean sStart() {
return ths.sStart;
}
prvate vod handleEvents() {
whle (ths.stateEvents.sze() > 0) {
try {
StateEvent stateEvent = ths.stateEvents.peek();
f (stateEventHandler(stateEvent)) {
ths.stateEvents.remove(stateEvent);
}
} catch (Excepton e) {
logger.error("state handle error:", e);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
publc Strng getKey() {
f (StrngUtls.sNotEmpty(key)
|| ths.processDefnton == null) {
return key;
}
key = Strng.format("%d_%d_%d",
ths.processDefnton.getCode(),
ths.processDefnton.getVerson(),
ths.processInstance.getId());
return key;
}
publc boolean addStateEvent(StateEvent stateEvent) {
f (processInstance.getId() != stateEvent.getProcessInstanceId()) {
logger.nfo("state event would be abounded :{}", stateEvent.toStrng());
return false;
}
ths.stateEvents.add(stateEvent);
return true;
}
publc nt eventSze() {
return ths.stateEvents.sze();
}
publc ProcessInstance getProcessInstance() {
return ths.processInstance;
}
prvate boolean stateEventHandler(StateEvent stateEvent) {
logger.nfo("process event: {}", stateEvent.toStrng());
f (!checkStateEvent(stateEvent)) {
return false; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
boolean result = false;
swtch (stateEvent.getType()) {
case PROCESS_STATE_CHANGE:
result = processStateChangeHandler(stateEvent);
break;
case TASK_STATE_CHANGE:
result = taskStateChangeHandler(stateEvent);
break;
case PROCESS_TIMEOUT:
result = processTmeout();
break;
case TASK_TIMEOUT:
result = taskTmeout(stateEvent);
break;
default:
break;
}
f (result) {
ths.stateEvents.remove(stateEvent);
}
return result;
}
prvate boolean taskTmeout(StateEvent stateEvent) {
f (taskInstanceHashMap.contansRow(stateEvent.getTaskInstanceId())) {
return true;
}
TaskInstance taskInstance = taskInstanceHashMap
.row(stateEvent.getTaskInstanceId())
.values() |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | .terator().next();
f (TmeoutFlag.CLOSE == taskInstance.getTaskDefne().getTmeoutFlag()) {
return true;
}
TaskTmeoutStrategy taskTmeoutStrategy = taskInstance.getTaskDefne().getTmeoutNotfyStrategy();
f (TaskTmeoutStrategy.FAILED == taskTmeoutStrategy) {
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId());
taskProcessor.acton(TaskActon.TIMEOUT);
return false;
} else {
processAlertManager.sendTaskTmeoutAlert(processInstance, taskInstance, taskInstance.getTaskDefne());
return true;
}
}
prvate boolean processTmeout() {
ths.processAlertManager.sendProcessTmeoutAlert(ths.processInstance, ths.processDefnton);
return true;
}
prvate boolean taskStateChangeHandler(StateEvent stateEvent) {
TaskInstance task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId());
f (task.getState().typeIsFnshed()) {
taskFnshed(task);
} else f (actveTaskProcessorMaps.contansKey(stateEvent.getTaskInstanceId())) {
ITaskProcessor TaskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId());
TaskProcessor.run();
f (TaskProcessor.taskState().typeIsFnshed()) {
task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId());
taskFnshed(task);
}
} else { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | logger.error("state handler error: {}", stateEvent.toStrng());
}
return true;
}
prvate vod taskFnshed(TaskInstance task) {
logger.nfo("work flow {} task {} state:{} ",
processInstance.getId(),
task.getId(),
task.getState());
f (task.taskCanRetry()) {
addTaskToStandByLst(task);
f (!task.retryTaskIntervalOverTme()) {
logger.nfo("falure task wll be submtted: process d: {}, task nstance d: {} state:{} retry tmes:{} / {}, nterval:{}",
processInstance.getId(),
task.getId(),
task.getState(),
task.getRetryTmes(),
task.getMaxRetryTmes(),
task.getRetryInterval());
ths.addTmeoutCheck(task);
} else {
submtStandByTask();
}
return;
}
ProcessInstance processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId());
completeTaskLst.put(Long.toStrng(task.getTaskCode()), task);
actveTaskProcessorMaps.remove(task.getId());
taskTmeoutCheckLst.remove(task.getId());
f (task.getState().typeIsSuccess()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | processInstance.setVarPool(task.getVarPool());
processServce.saveProcessInstance(processInstance);
submtPostNode(Long.toStrng(task.getTaskCode()));
} else f (task.getState().typeIsFalure()) {
f (task.sCondtonsTask()
|| DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) {
submtPostNode(Long.toStrng(task.getTaskCode()));
} else {
errorTaskLst.put(Long.toStrng(task.getTaskCode()), task);
f (processInstance.getFalureStrategy() == FalureStrategy.END) {
kllAllTasks();
}
}
}
ths.updateProcessInstanceState();
}
prvate boolean checkStateEvent(StateEvent stateEvent) {
f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) {
logger.error("msmatch process nstance d: {}, state event:{}",
ths.processInstance.getId(),
stateEvent.toStrng());
return false;
}
return true;
}
prvate boolean processStateChangeHandler(StateEvent stateEvent) {
try {
logger.nfo("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutonStatus());
processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId());
f (processComplementData()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | return true;
}
f (stateEvent.getExecutonStatus().typeIsFnshed()) {
endProcess();
}
f (processInstance.getState() == ExecutonStatus.READY_STOP) {
kllAllTasks();
}
return true;
} catch (Excepton e) {
logger.error("process state change error:", e);
}
return true;
}
prvate boolean processComplementData() throws Excepton {
f (!needComplementProcess()) {
return false;
}
Date scheduleDate = processInstance.getScheduleTme();
f (scheduleDate == null) {
scheduleDate = complementLstDate.get(0);
} else f (processInstance.getState().typeIsFnshed()) {
endProcess();
f (complementLstDate.sze() <= 0) {
logger.nfo("process complement end. process d:{}", processInstance.getId());
return true;
}
nt ndex = complementLstDate.ndexOf(scheduleDate);
f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().typeIsSuccess()) {
logger.nfo("process complement end. process d:{}", processInstance.getId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | return true;
}
logger.nfo("process complement contnue. process d:{}, schedule tme:{} complementLstDate:{}",
processInstance.getId(),
processInstance.getScheduleTme(),
complementLstDate.toStrng());
scheduleDate = complementLstDate.get(ndex + 1);
processInstance.setId(0);
}
processInstance.setScheduleTme(scheduleDate);
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
f (cmdParam.contansKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) {
cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING);
processInstance.setCommandParam(JSONUtls.toJsonStrng(cmdParam));
}
processInstance.setState(ExecutonStatus.RUNNING_EXECUTION);
processInstance.setGlobalParams(ParameterUtls.curngGlobalParams(
processDefnton.getGlobalParamMap(),
processDefnton.getGlobalParamLst(),
CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme()));
processInstance.setStartTme(new Date());
processInstance.setEndTme(null);
processServce.saveProcessInstance(processInstance);
ths.taskInstanceHashMap.clear();
startProcess();
return true;
}
prvate boolean needComplementProcess() { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (processInstance.sComplementData()
&& Flag.NO == processInstance.getIsSubProcess()) {
return true;
}
return false;
}
prvate vod startProcess() throws Excepton {
f (ths.taskInstanceHashMap.sze() == 0) {
sStart = false;
buldFlowDag();
ntTaskQueue();
submtPostNode(null);
sStart = true;
}
}
/**
* process end handle
*/
prvate vod endProcess() {
ths.stateEvents.clear();
processInstance.setEndTme(new Date());
ProcessDefnton processDefnton = ths.processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(),processInstance.getProcessDefntonVerson());
f (processDefnton.getExecutonType().typeIsSeralWat()) {
checkSeralProcess(processDefnton);
}
processServce.updateProcessInstance(processInstance);
f (processInstance.getState().typeIsWatngThread()) {
processServce.createRecoveryWatngThreadCommand(null, processInstance);
}
Lst<TaskInstance> taskInstances = processServce.fndValdTaskLstByProcessId(processInstance.getId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId());
processAlertManager.sendAlertProcessInstance(processInstance, taskInstances, projectUser);
}
publc vod checkSeralProcess(ProcessDefnton processDefnton) {
ths.processInstance = processServce.fndProcessInstanceById(processInstance.getId());
nt nextInstanceId = processInstance.getNextProcessInstanceId();
f (nextInstanceId == 0) {
ProcessInstance nextProcessInstance = ths.processServce.loadNextProcess4Seral(processInstance.getProcessDefnton().getCode(),ExecutonStatus.SERIAL_WAIT.getCode());
f (nextProcessInstance == null) {
return;
}
nextInstanceId = nextProcessInstance.getId();
}
ProcessInstance nextProcessInstance = ths.processServce.fndProcessInstanceById(nextInstanceId);
f (nextProcessInstance.getState().typeIsFnshed() || nextProcessInstance.getState().typeIsRunnng()) {
return;
}
Map<Strng, Object> cmdParam = new HashMap<>();
cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, nextInstanceId);
Command command = new Command();
command.setCommandType(CommandType.RECOVER_SERIAL_WAIT);
command.setProcessDefntonCode(processDefnton.getCode());
command.setCommandParam(JSONUtls.toJsonStrng(cmdParam));
processServce.createCommand(command);
}
/**
* generate process dag
*
* @throws Excepton excepton
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate vod buldFlowDag() throws Excepton {
f (ths.dag != null) {
return;
}
processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(),
processInstance.getProcessDefntonVerson());
recoverNodeIdLst = getStartTaskInstanceLst(processInstance.getCommandParam());
Lst<TaskNode> taskNodeLst =
processServce.transformTask(processServce.fndRelatonByCode(processDefnton.getProjectCode(), processDefnton.getCode()), Lsts.newArrayLst());
forbddenTaskLst.clear();
taskNodeLst.forEach(taskNode -> {
f (taskNode.sForbdden()) {
forbddenTaskLst.put(Long.toStrng(taskNode.getCode()), taskNode);
}
});
Lst<Strng> recoveryNodeCodeLst = getRecoveryNodeCodeLst();
Lst<Strng> startNodeNameLst = parseStartNodeName(processInstance.getCommandParam());
ProcessDag processDag = generateFlowDag(taskNodeLst,
startNodeNameLst, recoveryNodeCodeLst, processInstance.getTaskDependType());
f (processDag == null) {
logger.error("processDag s null");
return;
}
dag = DagHelper.buldDagGraph(processDag);
}
/**
* nt task queue
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate vod ntTaskQueue() {
taskFaledSubmt = false;
actveTaskProcessorMaps.clear();
dependFaledTask.clear();
completeTaskLst.clear();
errorTaskLst.clear();
Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(processInstance.getId());
for (TaskInstance task : taskInstanceLst) {
f (task.sTaskComplete()) {
completeTaskLst.put(Long.toStrng(task.getTaskCode()), task);
}
f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) {
contnue;
}
f (task.getState().typeIsFalure() && !task.taskCanRetry()) {
errorTaskLst.put(Long.toStrng(task.getTaskCode()), task);
}
}
f (processInstance.sComplementData() && complementLstDate.sze() == 0) {
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
f (cmdParam != null && cmdParam.contansKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) {
Date start = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE));
Date end = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE));
Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode(processInstance.getProcessDefntonCode());
f (complementLstDate.sze() == 0 && needComplementProcess()) {
complementLstDate = CronUtls.getSelfFreDateLst(start, end, schedules);
logger.nfo(" process defnton code:{} complement data: {}",
processInstance.getProcessDefntonCode(), complementLstDate.toStrng());
f (complementLstDate.sze() > 0 && Flag.NO == processInstance.getIsSubProcess()) {
processInstance.setScheduleTme(complementLstDate.get(0)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | processInstance.setGlobalParams(ParameterUtls.curngGlobalParams(
processDefnton.getGlobalParamMap(),
processDefnton.getGlobalParamLst(),
CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme()));
processServce.updateProcessInstance(processInstance);
}
}
}
}
}
/**
* submt task to execute
*
* @param taskInstance task nstance
* @return TaskInstance
*/
prvate TaskInstance submtTaskExec(TaskInstance taskInstance) {
try {
ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType());
f (taskInstance.getState() == ExecutonStatus.RUNNING_EXECUTION
&& taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) {
notfyProcessHostUpdate(taskInstance);
}
boolean submt = taskProcessor.submt(taskInstance, processInstance, masterConfg.getTaskCommtRetryTmes(), masterConfg.getTaskCommtInterval());
f (submt) {
ths.taskInstanceHashMap.put(taskInstance.getId(), taskInstance.getTaskCode(), taskInstance);
actveTaskProcessorMaps.put(taskInstance.getId(), taskProcessor);
taskProcessor.run();
addTmeoutCheck(taskInstance);
TaskDefnton taskDefnton = processServce.fndTaskDefnton( |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.getTaskCode(),
taskInstance.getTaskDefntonVerson());
taskInstance.setTaskDefne(taskDefnton);
f (taskProcessor.taskState().typeIsFnshed()) {
StateEvent stateEvent = new StateEvent();
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setExecutonStatus(taskProcessor.taskState());
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
ths.stateEvents.add(stateEvent);
}
return taskInstance;
} else {
logger.error("process d:{} name:{} submt standby task d:{} name:{} faled!",
processInstance.getId(), processInstance.getName(),
taskInstance.getId(), taskInstance.getName());
return null;
}
} catch (Excepton e) {
logger.error("submt standby task error", e);
return null;
}
}
prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) {
f (StrngUtls.sEmpty(taskInstance.getHost())) {
return;
}
try {
HostUpdateCommand hostUpdateCommand = new HostUpdateCommand();
hostUpdateCommand.setProcessHost(NetUtls.getAddr(masterConfg.getLstenPort())); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | hostUpdateCommand.setTaskInstanceId(taskInstance.getId());
Host host = new Host(taskInstance.getHost());
nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command());
} catch (Excepton e) {
logger.error("notfy process host update", e);
}
}
prvate vod addTmeoutCheck(TaskInstance taskInstance) {
f (taskTmeoutCheckLst.contansKey(taskInstance.getId())) {
return;
}
TaskDefnton taskDefnton = processServce.fndTaskDefnton(
taskInstance.getTaskCode(),
taskInstance.getTaskDefntonVerson()
);
taskInstance.setTaskDefne(taskDefnton);
f (TmeoutFlag.OPEN == taskDefnton.getTmeoutFlag() || taskInstance.taskCanRetry()) {
ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance);
} else {
f (taskInstance.sDependTask() || taskInstance.sSubProcess()) {
ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance);
}
}
}
/**
* fnd task nstance n db.
* n case submt more than one same name task n the same tme.
*
* @param taskCode task code
* @param taskVerson task verson |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @return TaskInstance
*/
prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) {
Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(ths.processInstance.getId());
for (TaskInstance taskInstance : taskInstanceLst) {
f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) {
return taskInstance;
}
}
return null;
}
/**
* encapsulaton task
*
* @param processInstance process nstance
* @param taskNode taskNode
* @return TaskInstance
*/
prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) {
TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson());
f (taskInstance == null) {
taskInstance = new TaskInstance();
taskInstance.setTaskCode(taskNode.getCode());
taskInstance.setTaskDefntonVerson(taskNode.getVerson());
taskInstance.setName(taskNode.getName());
taskInstance.setState(ExecutonStatus.SUBMITTED_SUCCESS);
taskInstance.setProcessInstanceId(processInstance.getId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setTaskType(taskNode.getType().toUpperCase());
taskInstance.setAlertFlag(Flag.NO);
taskInstance.setStartTme(null);
taskInstance.setFlag(Flag.YES);
taskInstance.setDryRun(processInstance.getDryRun());
taskInstance.setRetryTmes(0);
taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes());
taskInstance.setRetryInterval(taskNode.getRetryInterval());
taskInstance.setTaskParams(taskNode.getTaskParams());
f (taskNode.getTaskInstanceProrty() == null) {
taskInstance.setTaskInstanceProrty(Prorty.MEDIUM);
} else {
taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty());
}
Strng processWorkerGroup = processInstance.getWorkerGroup();
processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup;
Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup();
Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode();
Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode();
f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 6,613 | [Bug] [Master] A bug on task retry mechanism | ### 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
There are process nodes at the same level in the process, a failed error retry "node1_fail_retry" node (the actual task scenario may fail for the first time, and the task runs successfully after retry), and a failed "node2_fail" node;
The current phenomenon is that after the "node2_fail" node fails, the process is in the failure state, and the "node1_fail_retry" node will not retry the task (the retry state may be successful) and the subsequent tasks will not run;
Because the "node2_fail" node fails and the "errorTaskList" in the "MasterExecThread" is not empty, in the "processFailed()" method, "hasFailedTask()" returns true. When the FailureStrategy is CONTINUE, "activetasknode = 0", "processFailed()" returns false, causing the process instance state to change to failed.

### What you expected to happen
I think it is wrong not to retry the process node at the same level if it fails, because the actual task scenario may fail for the first time, run successfully after retrying, and then continue to run the downstream node.
### How to reproduce
1. Create a new process
2. Create a process node relationship as shown in the figure. The node "node1_fail_retry" is set error retry. The node "node2_fail" fails directly. Nodes "node3", "node4" and "node5 "can be created arbitrarily
3. Online process and runprocess

<img width="878" alt="22" src="https://user-images.githubusercontent.com/39785282/139022278-1eae4ae2-d935-429a-b861-3232733f73f1.png">
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/6613 | https://github.com/apache/dolphinscheduler/pull/6843 | 880c1d28ff7f334fd50b2376655f1a884fcb496a | 94f6c5c27ee88d5ec6f7f3856b2bc2aebab738e8 | "2021-10-27T07:45:37Z" | java | "2021-11-14T17:05:13Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setWorkerGroup(processWorkerGroup);
taskInstance.setEnvronmentCode(processEnvronmentCode);
} else {
taskInstance.setWorkerGroup(taskWorkerGroup);
taskInstance.setEnvronmentCode(taskEnvronmentCode);
}
f (!taskInstance.getEnvronmentCode().equals(-1L)) {
Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode());
f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) {
taskInstance.setEnvronmentConfg(envronment.getConfg());
}
}
taskInstance.setDelayTme(taskNode.getDelayTme());
}
return taskInstance;
}
publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) {
Map<Strng, Property> allProperty = new HashMap<>();
Map<Strng, TaskInstance> allTaskInstance = new HashMap<>();
f (CollectonUtls.sNotEmpty(preTask)) {
for (Strng preTaskCode : preTask) {
TaskInstance preTaskInstance = completeTaskLst.get(preTaskCode);
f (preTaskInstance == null) {
contnue;
}
Strng preVarPool = preTaskInstance.getVarPool();
f (StrngUtls.sNotEmpty(preVarPool)) {
Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class);
for (Property nfo : propertes) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.