Commons Net
  1. Commons Net
  2. NET-423

FTPClient.storeFile might fail when ControlKeepAliveTimeout is set

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.1
    • Component/s: FTP
    • Labels:
      None

      Description

      When setting ControlKeepAliveTimeout. FTPClient.__storeFile might fail when waiting for ack on ControlConnection.

      Current code:

              // Get the transfer response
              boolean ok = completePendingCommand();
              if (csl != null) {
                  csl.cleanUp(); // fetch any outstanding keepalive replies
              }
      

      While CSL is active, the ControlConnection timeout is set to 1 sec., if using default. This timeout value doesn't leave much room in terms of network/end point latency.

      Replacing the code fragment above with the following fragment probably solves the problem (If proper ControlConnection timeout value is set):

              if (csl != null) {
                  csl.cleanUp(); // fetch any outstanding keepalive replies
              }
              // Get the transfer response
              boolean ok = completePendingCommand();
      

      One workaround is to set ControlKeepAliveReplyTimeout to a higher value.

        Activity

        Hide
        Sebb added a comment -

        Same fix applies to retrieveFile method.

        Show
        Sebb added a comment - Same fix applies to retrieveFile method.
        Hide
        Gary Gregory added a comment -

        Fix typo in ticket tile.

        Show
        Gary Gregory added a comment - Fix typo in ticket tile.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jens Koch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development