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

Delay of around 5-6 seconds during SFTP Client file transfer using "storeFile" method of SFTP Client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.1
    • None
    • FTP
    • None
    • Solaris 10

    Description

      For transffering files over SFTP channel the below code snippet is being used -
      ---------------------------------------------------------------------------------------------
      File lLocalFile = new File(pLocalFilename);
      FileInputStream ip = new FileInputStream(lLocalFile);
      boolean lResult = ftp.storeFile(pRemoteFilename, ip);
      ip.close();
      ---------------------------------------------------------------------------------------------
      As per the code, The new SFTP channel is being established and then after around 2-3 mins, when trying to transfer a file from local to remote we can observed that the "storeFile" method is taking around 5-6 seconds to respond, and after that the lResult output is being received as "0" from the storeFile() method and the file transfer is getting failed.
      There is a timer for checking the FTP channels/FTP clients by "NOOP" operation command in every 1 second.
      But by closing and re-establishing the SFTP connection, then within a second the same file is getting transferred successfully. But again the same problem happened on the same connection after just 2-3 mins.

      There is another thread in the code part where from the same remote the code is reading and transferring file to local system by polling every 1 seconds successfully using SFTP connection. the code part for reading files -
      File lLocalFile = new File(pLocalFilename);
      FileOutputStream op = null;
      try

      { op = new FileOutputStream(lLocalFile); return ftp.retrieveFile(pRemoteFilename, op); }

      finally {
      if (op != null)

      { op.close(); }

      }
      Please can you help us to identify what is the problem for the SFTP connection that not allowing the File to be transferred from Local to Remote and the storefile method takes 5-6 seconds to responding. But just establishing the new connection, the file transferred but again the same problem happens for the same channel connection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sudipta.Panda Sudipta Panda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: