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

SO_TIMEOUT not really set on SFTP connections

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

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Pending Closed
    • 2.14.2, 2.15.2, 2.16.0
    • 2.14.3, 2.15.3, 2.16.0
    • camel-ftp
    • None
    • Unknown

    Description

      The documentation for the soTimeout parameter in the camel-ftp option says:
      FTP and FTPS Only: Camel 2.4: Is the SocketOptions.SO_TIMEOUT value in millis. Note SFTP will automatic use the connectTimeout as the soTimeout.

      The last statement is unfortunately not entirely true. JSCH's Session.connect(int connectTimeout) method will initially set the SO_TIMEOUT of the underlying socket to connectTimeout, however once the connection phase is finished, it will change this value to the provided timeout value.

      We have an incredibly broken SFTP server. On that connections sometimes hang after the connect phase, which causes polling consumer endpoints to hang in a Socket.read() forever (which means that they stop polling).

      IMO the fix for that is twofold:
      1. I attach a (trivial one-line) fix for the camel-ftp component, which will set the soTimeout parameter to the timeout parameter of the JSCH session.
      2. Someone with the access rights should modify the camel-ftp documentation
      3. It might make sense to set the default for the soTimeout parameter to something more sane than 0 (forever) but I don't do that in the patch (as it may change the existing behaviour).

      Attachments

        Activity

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

          People

            davsclaus Claus Ibsen
            siano Stephan Siano
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment