[ 
https://issues.apache.org/jira/browse/CAMEL-8860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14610017#comment-14610017
 ] 

Himanshu Mittal edited comment on CAMEL-8860 at 7/2/15 4:54 AM:
----------------------------------------------------------------

Grzegorz ,

{{passiveMode=true/false}} does not make any difference in number of connection 
being opened.
Here test sample is 200 messages with FTP sender. Screen shot shows number of 
connection reached up till 400( 2 per transaction) 
After removing tempfilename from URI we have a single tcp connection for 
transaction.
NetStat_NoTempFile.PNG
Passive_false_NoTempFile.log
NetStat_Passive_False.PNG
Passive_false.log
NetStat_Passive_True.PNG
Passive_True.log

As you mentioned in case of tempfileName there will be 3 active sockets else 
only 1 will be created. Tempfile configuration should yield just 3 times 
connection .
These configuration must not change the behavior of SO_REUSEADDR . 
Assume SO_REUSEADDR is set to false in my ftp server it could have created as 
many number of connections as there were transactions in both scenarios(with / 
without tempfilename ).
Currently I am figuring out to check SO_REUSEADDR property on my ftp server but 
I believe it is set to true as same connection is reused when we do not write 
temp files.



was (Author: himanshu):
Grzegorz ,

{{passiveMode=true/false}} does not make any difference in number of connection 
being opened.
Here test sample is 200 messages with FTP sender. Screen shot shows number of 
connection reached up till 400( 2 per transaction) 
After removing tempfilename from URI we have a single tcp connection for 
transaction.

NetStat_NoTempFile.PNG
Passive_false_NoTempFile.log
NetStat_Passive_False.PNG
Passive_false.log
NetStat_Passive_True.PNG
Passive_True.log



> Too many connection in TIME_WAIT when tempfilename is set in the FTP producer 
> URI.
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-8860
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8860
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.14.0
>            Reporter: Himanshu Mittal
>            Assignee: Grzegorz Grzybek
>         Attachments: NetStat_NoTempFIle.PNG, NetStat_Passive_False.PNG, 
> NetStat_Passive_true.PNG, Passive_false.log, Passive_false_NoTempFile.log, 
> Passive_true.log, ResultWithOutTempFileName.log, ResultWithTempfileName.log, 
> Result_With_tempfileName_FTPServer_Connection_Count.PNG, 
> Result_Without_tempfilename.PNG, TestFTPConnectionLeak.java
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to