sshj icon indicating copy to clipboard operation
sshj copied to clipboard

SFTPException... Caused by: java.lang.InterruptedException

Open j0kkeri opened this issue 3 years ago • 0 comments

I'm having occasional problem when renaming a file. Using following logic:

  1. Upload a file with a temp name
  2. When file upload OK, then rename file to final name ---> 0.000001% of time I get SFTPException Caused by InterruptedException - no exception message

On server side there is no errors and file rename is successfull. SSHJ debug log does not write any errors... I am using also keepalive like this ssh.getConnection().getKeepAlive().setKeepAliveInterval(60);

Here's the stacktrace:

net.schmizz.sshj.sftp.SFTPException
	at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:33)
	at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:26)
	at net.schmizz.concurrent.Promise.tryRetrieve(Promise.java:179)
	at net.schmizz.concurrent.Promise.retrieve(Promise.java:137)
	at net.schmizz.sshj.sftp.SFTPEngine.doRequest(SFTPEngine.java:144)
	at net.schmizz.sshj.sftp.SFTPEngine.rename(SFTPEngine.java:237)
	at net.schmizz.sshj.sftp.SFTPClient.rename(SFTPClient.java:120)
	at com.my.classes.hidden......writeFileToServerWithTempname(Unknown Source)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2151)
	at net.schmizz.concurrent.Promise.tryRetrieve(Promise.java:170)
	... 13 more

Can this issue be related on SSHJ-library? Tested with latest version 0.32

j0kkeri avatar Mar 03 '22 06:03 j0kkeri