Skip to content

Commit c8fcfbb

Browse files
authored
Merge 4386a44 into ead5453
2 parents ead5453 + 4386a44 commit c8fcfbb

File tree

2 files changed

+5
-4
lines changed
  • dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh
  • dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell

2 files changed

+5
-4
lines changed

dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static ClientSession getSession(SshClient client, SSHConnectionParam conn
5959
throw new Exception("Failed to add public key identity", e);
6060
}
6161
}
62-
session.setSessionHeartbeat(SessionHeartbeatController.HeartbeatType.RESERVED, Duration.ofSeconds(3));
62+
session.setSessionHeartbeat(SessionHeartbeatController.HeartbeatType.IGNORE, Duration.ofSeconds(3));
6363
return session;
6464
}
6565
}

dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ public Integer getTaskExitCode(String taskId) throws IOException {
141141
}
142142
}
143143
cleanData(taskId);
144-
log.error("Remote shell task failed");
145144
return exitCode;
146145
}
147146

@@ -232,8 +231,10 @@ public String runRemote(String command) throws IOException {
232231
channel.open();
233232
channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED), 0);
234233
channel.close();
235-
if (channel.getExitStatus() != 0) {
236-
throw new TaskException("Remote shell task error, error message: " + err.toString());
234+
Integer exitStatus = channel.getExitStatus();
235+
if (exitStatus == null || exitStatus != 0) {
236+
throw new TaskException(
237+
"Remote shell task error, exitStatus: " + exitStatus + " error message: " + err);
237238
}
238239
return out.toString();
239240
}

0 commit comments

Comments
 (0)