reele commented on code in PR #16980:
URL: 
https://github.com/apache/dolphinscheduler/pull/16980#discussion_r1928027972


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/TaskFailureStateAction.java:
##########
@@ -130,6 +130,17 @@ public void killEventAction(final 
IWorkflowExecutionRunnable workflowExecutionRu
                                 final ITaskExecutionRunnable 
taskExecutionRunnable,
                                 final TaskKillLifecycleEvent taskKillEvent) {
         throwExceptionIfStateIsNotMatch(taskExecutionRunnable);
+        final IWorkflowExecutionGraph workflowExecutionGraph = 
taskExecutionRunnable.getWorkflowExecutionGraph();
+        // for now, killEventAction can be fired on failure with retry
+        // there is no task executor now, shouldn't call 
workflowExecutionGraph.isTaskExecutionRunnableActive()
+        // it's better to call super.killedEventAction() direct
+        if (taskExecutionRunnable.isTaskInstanceCanRetry()
+        // && 
workflowExecutionGraph.isTaskExecutionRunnableActive(taskExecutionRunnable)
+        ) {
+            super.killedEventAction(workflowExecutionRunnable, 
taskExecutionRunnable,
+                    TaskKilledLifecycleEvent.of(taskExecutionRunnable));
+            return;
+        }

Review Comment:
   i'm a bit confused about this:
   when task is failed and going to waiting retry, this task was not removed 
from `WorkflowExecutionGraph.activeTaskExecutionRunnable`, 
`activeTaskExecutionRunnable.add()` in `isTaskExecutionRunnableActive` will 
always return `false`, this result prevented the execution of if-block.
   
   or `WorkflowExecutionGraph.isTaskExecutionRunnableActive` should call 
`activeTaskExecutionRunnable.contains` instead of 
`activeTaskExecutionRunnable.add()` ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to