mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 04:08:31 +08:00
Fix task instance will generate multiple times when retry interval is 0/s (#13571)
This commit is contained in:
parent
dd4804ee4c
commit
e8b20def54
@ -57,10 +57,19 @@ public class TaskStateEventHandler implements StateEventHandler {
|
||||
task.getState(), taskStateEvent.getStatus());
|
||||
|
||||
Map<Long, Integer> completeTaskMap = workflowExecuteRunnable.getCompleteTaskMap();
|
||||
if (task.getState().isFinished()
|
||||
&& (taskStateEvent.getStatus() != null && taskStateEvent.getStatus().isRunning())) {
|
||||
String errorMessage = String.format(
|
||||
"The current task instance state is %s, but the task state event status is %s, so the task state event will be ignored",
|
||||
task.getState(),
|
||||
taskStateEvent.getStatus());
|
||||
log.warn(errorMessage);
|
||||
throw new StateEventHandleError(errorMessage);
|
||||
}
|
||||
|
||||
if (task.getState().isFinished()) {
|
||||
if (completeTaskMap.containsKey(task.getTaskCode())
|
||||
&& completeTaskMap.get(task.getTaskCode()) == task.getId()) {
|
||||
&& completeTaskMap.get(task.getTaskCode()).equals(task.getId())) {
|
||||
log.warn("The task instance is already complete, stateEvent: {}", stateEvent);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user