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

SO_TIMEOUT not really set on SFTP connections

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Pending Closed
    • Affects Version/s: 2.14.2, 2.15.2, 2.16.0
    • Fix Version/s: 2.14.3, 2.15.3, 2.16.0
    • Component/s: camel-ftp
    • Labels:
      None
    • Estimated Complexity:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: