ruanwenjun commented on code in PR #11668:
URL: https://github.com/apache/dolphinscheduler/pull/11668#discussion_r962620772


##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java:
##########
@@ -95,8 +95,14 @@ public void process(Channel channel, Command command) {
         }
 
         int processId = taskExecutionContext.getProcessId();
-        if (processId == 0) {
-            this.cancelApplication(taskInstanceId);
+
+        this.cancelApplication(taskInstanceId);
+
+        Pair<Boolean, List<String>> result = doKill(taskExecutionContext);
+
+        // if processId = 0 and yarn application_id list is empty, the task 
has not been executed and has been cancelled.

Review Comment:
   ```suggestion
   
   ```
   If the processId is 0, means the task doen't create a process.



##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java:
##########
@@ -95,8 +95,14 @@ public void process(Channel channel, Command command) {
         }
 
         int processId = taskExecutionContext.getProcessId();
-        if (processId == 0) {
-            this.cancelApplication(taskInstanceId);
+
+        this.cancelApplication(taskInstanceId);
+
+        Pair<Boolean, List<String>> result = doKill(taskExecutionContext);
+
+        // if processId = 0 and yarn application_id list is empty, the task 
has not been executed and has been cancelled.
+
+        if (processId == 0 && result.getRight().isEmpty()) {

Review Comment:
   Please revert this, this will cause memory leak if the kill yarn failed.



-- 
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