Skip to content

Commit 6c8e8ab

Browse files
苏义超ruanwenjun
authored andcommitted
remove redundant cancelApplication
1 parent 19850fa commit 6c8e8ab

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api

dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.apache.dolphinscheduler.common.constants.Constants.EMPTY_STRING;
2121
import static org.apache.dolphinscheduler.common.constants.Constants.SLEEP_TIME_MILLIS;
2222
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.EXIT_CODE_FAILURE;
23+
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.EXIT_CODE_HARD_KILL;
2324
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.EXIT_CODE_KILL;
2425

2526
import org.apache.dolphinscheduler.common.thread.ThreadUtils;
@@ -190,13 +191,13 @@ public TaskResponse run(IShellInterceptorBuilder iShellInterceptorBuilder,
190191
result.setExitStatusCode(this.process.exitValue());
191192

192193
} else {
193-
log.error("process has failure, the task timeout configuration value is:{}, ready to kill ...",
194-
taskRequest.getTaskTimeout());
194+
log.error("process has failure due to timeout kill, timeout value is:{}, timeoutStrategy is:{}",
195+
taskRequest.getTaskTimeout(), taskRequest.getTaskTimeoutStrategy());
195196
result.setExitStatusCode(EXIT_CODE_FAILURE);
196-
cancelApplication();
197197
}
198198
int exitCode = this.process.exitValue();
199-
String exitLogMessage = EXIT_CODE_KILL == exitCode ? "process has killed." : "process has exited.";
199+
String exitLogMessage = (EXIT_CODE_KILL == exitCode || EXIT_CODE_HARD_KILL == exitCode) ? "process has killed."
200+
: "process has exited.";
200201
log.info("{} execute path:{}, processId:{} ,exitStatusCode:{} ,processWaitForStatus:{} ,processExitValue:{}",
201202
exitLogMessage, taskRequest.getExecutePath(), processId, result.getExitStatusCode(), status, exitCode);
202203
return result;

0 commit comments

Comments
 (0)