Jsch:channel never closed or EOF channel not closed

Source: Internet
Author: User

Recently, our project used the Jsch library when developing remote node management. When the test found that a node after the execution of the CMD, channel.isclosed () has been false, resulting in the request can not be returned, but some other nodes are not related, the direct execution is normal, the return code is identical. Google has not found a solution such as https://github.com/lucastheisen/jsch-extension/issues/6,https://stackoverflow.com/ Questions/12138777/jsch-channel-never-closed-or-eof (plus exit does not work), after careful research and analysis, and post https://sourceforge.net/p/jsch/ MAILMAN/MESSAGE/24270241/, there may indeed be cases where the channel cannot detect close. Final Workaround:

Judging whether the Channel.exitstatus is 0, 0 represents the normal end, because 1 means the command has not been executed. Follow-up observation to see if there are any other incorrect false positives.

Reference:

https://sourceforge.net/p/jsch/mailman/jsch-users/thread/4B39D620.30006%40i4s.co.jp/#msg24270241

Jsch:channel never closed or EOF channel not closed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.