Commons Net
  1. Commons Net
  2. NET-434

FTPClient fails to close local listener socket when command socket channel encounter "ReadTimeoutException"

    Details

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

      Red Hat Enterprise Linux Server release 5.6 (Tikanga) x64
      java version "1.6.0_26"
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

      Description

      FtpClient connect to an ftp server and login successfully, call ftpClient.listFiles() method to list remote directory,
      and ftp server is vsftp and use active mode.
      on commons-net-3.0.1 class org.apache.commons.net.ftp.FTPClient at line 680 :
      if (!FTPReply.isPositivePreliminary(sendCommand(command, arg)))

      { server.close(); return null; }

      call sendCommand throw an exception blow:

      java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
      at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
      at java.io.InputStreamReader.read(InputStreamReader.java:167)
      at java.io.BufferedReader.fill(BufferedReader.java:136)
      at java.io.BufferedReader.readLine(BufferedReader.java:299)
      at java.io.BufferedReader.readLine(BufferedReader.java:362)
      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:299)
      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:500)

      class org.apache.commons.net.ftp.FTPClient at line 648 : ServerSocket server = serverSocketFactory.createServerSocket(getActivePort(), 1, getHostAddress());

      the local listener socket "server" is not close when sendCommand method throws exception.

        Activity

        zhangyong created issue -
        Sebb made changes -
        Field Original Value New Value
        Summary FTP Client not close local listener socket when command socket channel encounter "ReadTimeoutExceptoin" FTPClient fails to close local listener socket when command socket channel encounter "ReadTimeoutException"
        Sebb made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.1 [ 12317744 ]
        Resolution Fixed [ 1 ]
        Sebb made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development