[
https://issues.apache.org/jira/browse/SSHD-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17248108#comment-17248108
]
min yun law edited comment on SSHD-1085 at 12/11/20, 6:41 PM:
--------------------------------------------------------------
tested 2.6.0, I dont see the block issue by the channel.waitFor()
There is another channel issue. when I test more than 4 channels (threads) to
run the same command(hostname;uptime) to same host, some channel(thread) only
return CLOSED status and no output result.
so how many channels can be open for one ClientSession object?
My testing case is to have 100 threads to run the same command
(hostname;uptime) to the same host with only one ClientSession object, we have
channel control code to allow MAX channels to run parallel.
was (Author: minlaw):
tested 2.6.0, I dont see the block issue by the channel.waitFor()
There is another channel issue. when I test more than 4 channels (threads) to
run the same command(hostname;uptime) to same host, some channel(thread) only
return CLOSED status and no output result.
so how many channels can be open for one ClientSession object?
> 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
> Assignee: Lyor Goldstein
> 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]