Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12472

Downloading a large file with streamDownload and stepwise hangs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.21.0
    • Fix Version/s: None
    • Component/s: camel-ftp
    • Labels:
      None
    • Environment:
      • Camel versions: 2.17.0 and 2.21.0
      • Ftp servers: plain vsftpd server, org.apache.ftpserver as a mock, Camel test environment ftp.
      • Files: depending on configuration from 1mb to 5mb file is vital for error to happen. 
    • Estimated Complexity:
      Unknown

      Description

      Downloading a file exceeding certain, system-dependent size with streamDownload and stepwise options turned on hangs and causes timeout.

      I prepared a test which triggers the error. The patch file is pretty big, as I had to make a file enough big to make the timeout happen. Basing on my predictions, the size of the file triggering the error depends on FTP configuration and Java caching policy (no proof available yet). Working with plain Vsftpd server even 1mb files triggered timeouts. In the test environment the limit on my desktop is 5 mb. If the test passes, please make the file bigger.

      My intepretation of the problem:

      1. Start downloading a file with size exceeding InputStream cache (on my pc approx. 1mb is the limit).
        FtpOperations.java:373
        InputStream is = this.client.retrieveFileStream(remoteName);
        
      2.  The server responds 150 and opens data connection.
        [user_ftp] FTP response: Client "127.0.0.1", "150 Opening BINARY mode data connection for x (1048576 bytes)."
        
      3. The data connection does not end because InputStream is waiting for reads and it has not cached whole file. No "226 Transfer complete" response from server.
      4. Try to change directory as stepwise is turned on.
        FtpOperations.java:387
        this.changeCurrentDirectory(currentDir);
        
      5. Camel hangs as the server is still in the data connection and we are waiting for response from CWD command.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              karol.koltun Karol Koltun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: