Timeout when executing ls() method
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 620
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 11
Description
We're using com.hierynomus:sshj:0.24.0 for our SFTP Connector. For almost all of our customers, it's working great. For one, when they attempt to list the contents of a directory they are consistently receiving a "Timeout expired" on ls() command execution.
When tested directly from sftp in command line, listing contents is same directory requires slightly more than 60 seconds.
We are using the default timeouts in SSHJ at this point.
**SocketClient**
It appears that SocketClient uses 0 seconds as the default, which should be an infinite timeout (according to Socket JavaDoc).
**TransportImpl**
Appears to set 30 seconds as the transport socket timeout:
`private volatile int timeoutMs = 30 * 1000; // Crazy long, but it was the original default`
Our assumption is that we're hitting the Transport timeout and need to set a custom value for this customer as follows. Does this sound correct?
`sshClient.getTransport.setTimeoutMs()`
Stack Trace
`2018-08-23 22:43:27.861 GMT+0000 INFO ConnectorSFTP - Caused by: net.schmizz.sshj.sftp.SFTPException: Timeout expired
2018-08-23 22:43:27.861 GMT+0000 INFO ConnectorSFTP - at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:33)
2018-08-23 22:43:27.861 GMT+0000 INFO ConnectorSFTP - at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:26)
2018-08-23 22:43:27.862 GMT+0000 INFO ConnectorSFTP - at net.schmizz.concurrent.Promise.retrieve(Promise.java:140)
2018-08-23 22:43:27.862 GMT+0000 INFO ConnectorSFTP - at net.schmizz.sshj.sftp.RemoteDirectory.scan(RemoteDirectory.java:38)
2018-08-23 22:43:27.862 GMT+0000 INFO ConnectorSFTP - at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:59)
2018-08-23 22:43:27.862 GMT+0000 INFO ConnectorSFTP - at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:52)`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.