Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-592

plainSocket in FTPSClient is never closed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5
    • Fix Version/s: 3.6
    • Component/s: FTP
    • Labels:
      None

      Description

      The plainSocket field in the FTPSClient is never closed. Over time, this will lead to an IOException with "too many open files".

      To recreate this, try the following in a loop:

      • create an FTPSClient
      • call the login
      • upload a file
      • download the file
      • call logout
      • disconnect within a finally block

      I would expect the disconnect call would release all of the file descriptors but if you set a breakpoint you'll notice that this socket remains open.

      In my test driver, this eventually fails after 8,000 iterations until it hits the max file descriptors for the test process.

      If I use some reflection code and force FTPSClient.plainSocket to be accessible so I can close it, then everything works.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              massfords Mark Ford
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: