hierynomus / sshj

ssh, scp and sftp for java
Apache License 2.0
2.49k stars 602 forks source link

use watchdog to close session failed. #935

Open wangjunhan2018 opened 6 months ago

wangjunhan2018 commented 6 months ago

I use jnc library,it use sshj. image when close(), error as fllows, please help me!!! Thank you!!!

2024-03-15 01:17:13.585 WARN 10666 --- [ Thread-3] com.baidu.jnc.SSHSession : read timeout, closing session Exception caught while closing net.schmizz.sshj.connection.ConnectionException net.schmizz.sshj.connection.ConnectionException at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:32) at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:26) at net.schmizz.concurrent.Promise.tryRetrieve(Promise.java:179) at net.schmizz.concurrent.Promise.retrieve(Promise.java:137) at net.schmizz.concurrent.Event.await(Event.java:105) at net.schmizz.sshj.connection.channel.AbstractChannel.close(AbstractChannel.java:266) at com.baidu.jnc.SSHSession.close(SSHSession.java:260) at com.baidu.jnc.SSHSession$TimeoutWatchdog.run(SSHSession.java:100) Caused by: java.lang.InterruptedException at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2197) at net.schmizz.concurrent.Promise.tryRetrieve(Promise.java:170) ... 5 more

wangjunhan2018 commented 6 months ago

Is there anyone can answer this question?

martin-volf commented 6 months ago

I am a maintainer of the original JNC library, so I can comment: an exception in TimeoutWatchdog means that reading from the remote device took longer than the read timeout you set for your SSH session. But you are using jnc from com.baidu, so you should ask them if more details are needed.