Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ssh heartbeat type to IGNORE #15858

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static ClientSession getSession(SshClient client, SSHConnectionParam conn
throw new Exception("Failed to add public key identity", e);
}
}
session.setSessionHeartbeat(SessionHeartbeatController.HeartbeatType.RESERVED, Duration.ofSeconds(3));
session.setSessionHeartbeat(SessionHeartbeatController.HeartbeatType.IGNORE, Duration.ofSeconds(3));
return session;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public Integer getTaskExitCode(String taskId) throws IOException {
}
}
cleanData(taskId);
log.error("Remote shell task failed");
return exitCode;
}

Expand Down Expand Up @@ -232,8 +231,10 @@ public String runRemote(String command) throws IOException {
channel.open();
channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED), 0);
channel.close();
if (channel.getExitStatus() != 0) {
throw new TaskException("Remote shell task error, error message: " + err.toString());
Integer exitStatus = channel.getExitStatus();
if (exitStatus == null || exitStatus != 0) {
throw new TaskException(
"Remote shell task error, exitStatus: " + exitStatus + " error message: " + err);
}
return out.toString();
}
Expand Down
Loading