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

channel does not close after executing long running command #709

Open
yunmengmeng opened this issue Nov 13, 2024 · 2 comments
Open

channel does not close after executing long running command #709

yunmengmeng opened this issue Nov 13, 2024 · 2 comments

Comments

@yunmengmeng
Copy link

execChannel.setCommand(cmd);
execChannel.connect(timeOut);
while (!execChannel.isClosed()) {
    TimeUnit.MILLISECONDS.sleep(100);
}

I used to running cp xxx xxx,the file size is 13G,it takes serveral minutes to finish.but sometimes execChannel.isClosed() always return false and execChannel.getExitStatus() always return -1. So this code can't break out the loop.but on the server, cp process is finish and the server doesn't have this process.
So i guess it may because of long command, or channel doesn't receive end message from the server. But not happens every time.
Jsch version is 0.1.55.How to fix it?

@yunmengmeng
Copy link
Author

it happend again when executing sleep 1800

@norrisjeremy
Copy link
Contributor

Hi @yunmengmeng,

JSch 0.1.55 is a very old version that was published well before this fork of the project was created.
Have you attempted to use our most recent release (0.2.21) to confirm whether this problem still occurs?

Thanks,
Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants