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

came-ftp - streamDownload=true and stepwise=true for larger files could cause deadlock

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • camel-ftp
    • None
    • Unknown

    Description

      If downloading files of size bigger then about 0,5 MB (differs on other parameters) with option streamDownload=true and stepwise=true (default values), operation could freeze (on my local environment it freezes with 100% certainty), because retrieved inputstream has to be closed before calling other commands .
      See https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html#retrieveFileStream(java.lang.String)

      To finalize the file transfer you must call completePendingCommand and check its return value to verify success. If this is not done, subsequent commands may behave unexpectedly.

      Problem happens if retrieval of file is immediately followed by change of directory.

      I can imagine fix, which doesn't make change of directory, if is not necessary and it would be nice to add note to documentation, that streamDownload and stepWise options together could cause unexpected behavior for larger filespossibly (possible freeze of component)

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jondruse Jiri Ondrusek
            jondruse Jiri Ondrusek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment