mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 03:08:01 +08:00
Fix recovery from failed task will dead loop (#11239)
This commit is contained in:
parent
caa6287d7f
commit
04f3aa9713
@ -83,7 +83,6 @@ import org.apache.dolphinscheduler.service.process.ProcessService;
|
||||
import org.apache.dolphinscheduler.service.queue.PeerTaskInstancePriorityQueue;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
||||
@ -1818,10 +1817,13 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> {
|
||||
|
||||
// todo: Can we use a better way to set the recover taskInstanceId list? rather then use the cmdParam
|
||||
if (paramMap != null && paramMap.containsKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) {
|
||||
String[] idList = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).split(Constants.COMMA);
|
||||
if (ArrayUtils.isNotEmpty(idList)) {
|
||||
List<Integer> taskInstanceIds = Arrays.stream(idList).map(Integer::valueOf).collect(Collectors.toList());
|
||||
return processService.findTaskInstanceByIdList(taskInstanceIds);
|
||||
List<Integer> startTaskInstanceIds = Arrays.stream(paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING)
|
||||
.split(COMMA))
|
||||
.filter(StringUtils::isNotEmpty)
|
||||
.map(Integer::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(startTaskInstanceIds)) {
|
||||
return processService.findTaskInstanceByIdList(startTaskInstanceIds);
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
|
Loading…
Reference in New Issue
Block a user