From 2e83e57ec25e9aa9a1cfaa75d96867a2afbd4688 Mon Sep 17 00:00:00 2001 From: shileinice <1084623299@qq.com> Date: Sun, 25 Feb 2024 13:46:54 +0800 Subject: [PATCH 1/2] fix kill remote shell task and print exception log --- .../dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java | 1 - .../plugin/task/remoteshell/RemoteShellTask.java | 1 - 2 files changed, 2 deletions(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java index c590fa9e44..614ce3555e 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java @@ -156,7 +156,6 @@ public class RemoteExecutor implements AutoCloseable { String pid = getTaskPid(taskId); String killCommand = String.format(COMMAND.KILL_COMMAND, pid); runRemote(killCommand); - cleanData(taskId); } public String getTaskPid(String taskId) throws IOException { diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java index 6c55f069e1..a9cf108773 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java @@ -90,7 +90,6 @@ public class RemoteShellTask extends AbstractTask { taskId = TASK_ID_PREFIX + taskExecutionContext.getTaskInstanceId(); } setAppIds(taskId); - taskExecutionContext.setAppIds(taskId); initRemoteExecutor(); } From c3f17fe66cd7784821459ae0057f4fa44afd9a5a Mon Sep 17 00:00:00 2001 From: shileinice <1084623299@qq.com> Date: Sun, 10 Mar 2024 20:08:14 +0800 Subject: [PATCH 2/2] revert to this logic --- .../dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java index 614ce3555e..c590fa9e44 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java @@ -156,6 +156,7 @@ public class RemoteExecutor implements AutoCloseable { String pid = getTaskPid(taskId); String killCommand = String.format(COMMAND.KILL_COMMAND, pid); runRemote(killCommand); + cleanData(taskId); } public String getTaskPid(String taskId) throws IOException {