#76 Connection drops at loading huge files

v1.0 (example)
open
nobody
None
5
2015-11-30
2014-09-01
No

When I am loading huge files from sftp using JSch, there is a constantly reproduced connection drop issue. Stacktrace is:

Caused by: com.jcraft.jsch.SftpException:
at com.jcraft.jsch.ChannelSftp._get(ChannelSftp.java:1160) ~[jsch-0.1.51.jar:na]
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:961) ~[jsch-0.1.51.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader.downloadFileSftp(SftpDownloader.java:368) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader.downloadFilesSftp(SftpDownloader.java:341) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader.loadFilesSequentally(SftpDownloader.java:274) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader.downloadFiles(SftpDownloader.java:227) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader.access$600(SftpDownloader.java:36) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.sftp.SftpDownloader$DownloadFilesAction.run(SftpDownloader.java:508) ~[fsdf-commons-1.3.19.jar:na]
at com.revere.fsdf.commons.utils.Utils.executeWithRetryAttempts(Utils.java:395) ~[fsdf-commons-1.3.19.jar:na]
... 5 common frames omitted
Caused by: java.io.IOException: inputstream is closed
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2884) ~[jsch-0.1.51.jar:na]
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2908) ~[jsch-0.1.51.jar:na]
at com.jcraft.jsch.ChannelSftp._get(ChannelSftp.java:1062) ~[jsch-0.1.51.jar:na]
... 13 common frames omitted

I was able to reproduce connection drops constantly on JSch version 0.1.51, time by time, when loading 1.8 Gb zip file in a single thread on SunOS 5.11 and with Java 1.7.

I have tried to set:

but this didn't help.

On JSch version 0.1.40 download proceeds without errors (no environment changes were done, only version decreasing).

Discussion

  • I have tried to set:

    session.setServerAliveInterval(1000); // default was '0'
    session.setServerAliveCountMax(3); // default was '1'

    but this didn't help.

     
  • I have the same issue with big .mp4 or .pdf files.

    Any updates about that?