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

Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.14.0
    • None
    • camel-ftp
    • None
    • Unknown

    Description

      So many connections remain in TIME_WAIT state while configuring a FTP producer route with tempfilename property in FTP producer.

      Files are writen using producer template.

      Producertemplate.sendBodyAndHeader(producerURI, Exchange.FILE_NAME, fileName) to write file to destination.

      Producer URI : ftp://<USER@MACHINE_ADDRESS>//?password=RAW(PASSWORD)&binary=true&passiveMode=false&delete=true&pollStrategy=#ConsumerPollStrategy&disconnect=false&tempFileName=/temp/hello.tmp&initialDelay=10&throwExceptionOnConnectFailed=true&reconnectDelay=10&maximumReconnectAttempts=0&maxMessagesPerPoll=100&readLock=changed&readLockCheckInterval=500&readLockMinLength=1&sendEmptyMessageWhenIdle=true

      fileName: file.tmp

      We are writing ~ 2000 files . First files are written to temp directory then moved to destination. Connections opened for tempfiles are not re used to write temporary files and we run out of connection after writing 1000 files.
      Route resumes once connections are released.
      Is there a way we can reuse connection to write temporary files also.

      Once tempfilename is removed from the configuration then single connection is used for ftp transfer.

      Attachments

        1. TestFTPConnectionLeak.java
          1 kB
          Himanshu Mittal
        2. ResultWithTempfileName.log
          5.32 MB
          Himanshu Mittal
        3. ResultWithOutTempFileName.log
          4.53 MB
          Himanshu Mittal
        4. Result_Without_tempfilename.PNG
          60 kB
          Himanshu Mittal
        5. Result_With_tempfileName_FTPServer_Connection_Count.PNG
          66 kB
          Himanshu Mittal
        6. Passive_true.log
          229 kB
          Himanshu Mittal
        7. Passive_false.log
          230 kB
          Himanshu Mittal
        8. Passive_false_NoTempFile.log
          196 kB
          Himanshu Mittal
        9. NetStat_Passive_true.PNG
          50 kB
          Himanshu Mittal
        10. NetStat_Passive_False.PNG
          41 kB
          Himanshu Mittal
        11. NetStat_NoTempFIle.PNG
          43 kB
          Himanshu Mittal

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              himanshu Himanshu Mittal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: