[
https://issues.apache.org/jira/browse/SSHD-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246723#comment-17246723
]
Lyor Goldstein commented on SSHD-1085:
--------------------------------------
{quote}
if run "reboot -f", it will take a little long but can get return with status
"CLOSED" and "OPEN", But does not has "EXIT_STATUS"
{quote}
Like I already explained, I don't see how an exit status is returned on reboot
(even for Jsch - unless they "synthesize" one)
{quote}
see the channel wait for something back that cause get stuck.
{quote}
>From what you describe it seems that the TCP connection never times out - it
>would help a lot if you could provide some logs as to what happens slightly
>before and after you issue the reboot command. For now let me suggest
>something - try configuring the {{"nio2-read-timeout"}} property value and see
>if it helps. Note though it affects your code +globally+ and may cause
>timeouts on "silent" connections (ones without much traffic)
{quote}
we dont see Jsch has such issue.
{quote}
I would suggest you use it for the time being for the reboot command until some
fix becomes - which may take quite a while...
> channel.waitFor() get stuck when run reboot command
> ---------------------------------------------------
>
> Key: SSHD-1085
> URL: https://issues.apache.org/jira/browse/SSHD-1085
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.5.1
> Environment: linux
> Reporter: min yun law
> Priority: Major
>
> Trying to run linux command "reboot" by mina sshd to remote node, the node is
> in reboot, but the ClientChannel object still keep open, not in closed
> status, Here is the logic code in my project:
>
> {code:java}
> String command = "reboot";
> ChannelExec channel = clientSession.createExecChannel(command);
> if(!channel.isClosed())
> {
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> ByteArrayOutputStream err = new ByteArrayOutputStream(); channel.setOut(out);
> channel.setErr(err);
> channel.open().await(); //this passed
> //follow call will cause stuck
> Collection<ClientChannelEvent> waitMask =
> channel.waitFor(REMOTE_COMMAND_WAIT_EVENTS, 0L);
> String outputStr = new String(out.toByteArray(), StandardCharsets.UTF_8);
> //some case this will throw runtime exception
> int exitStatus = channel.getExitStatus();
> }
>
> {code}
>
> So why the ChannelExec cannot get the correct channel status when remote node
> is rebooting?
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]