sshj icon indicating copy to clipboard operation
sshj copied to clipboard

SCP File uploads stuck if the remote didn't send status code

Open DImuthuUpe opened this issue 3 years ago • 1 comments

The file upload thread is stuck at SCPEngine.check method probably because the remote didn't respond with the completion status code. While these are possible due to network issues, the client might need to wait for some time and invoke a timeout with an error to the user. Please look at the thread dump

"TaskStateModelFactory-task_thread-6" #78 daemon prio=5 os_prio=0 cpu=39889.63ms elapsed=1726257.09s tid=0x00007f27b4073000 nid=0x23c6 in Object.wait()  [0x00007f27976f4000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <no object reference available>
	at java.lang.Object.wait([email protected]/Object.java:328)
	at net.schmizz.sshj.connection.channel.ChannelInputStream.read(ChannelInputStream.java:103)
	- waiting to re-lock in wait() <0x0000000092ae8e60> (a net.schmizz.sshj.common.Buffer$PlainBuffer)
	at net.schmizz.sshj.connection.channel.ChannelInputStream.read(ChannelInputStream.java:86)
	- locked <0x0000000092ae8e78> (a [B)
	at net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:60)
	at net.schmizz.sshj.xfer.scp.SCPUploadClient.sendFile(SCPUploadClient.java:100)
	at net.schmizz.sshj.xfer.scp.SCPUploadClient.process(SCPUploadClient.java:78)
	at net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:70)
	at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:50)
	- eliminated <owner is scalar replaced> (a net.schmizz.sshj.xfer.scp.SCPUploadClient)	at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:43)
	- eliminated <owner is scalar replaced> (a net.schmizz.sshj.xfer.scp.SCPUploadClient)	at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:55)

DImuthuUpe avatar Oct 04 '21 15:10 DImuthuUpe

@hierynomus suggestion to fix this?

DImuthuUpe avatar Oct 08 '21 14:10 DImuthuUpe