You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Himanshu Mittal <hi...@gmail.com> on 2015/06/09 11:58:49 UTC

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

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

I am using 
*Producertemplate.sendBodyAndHeader(producerURI, Exchange.FILE_NAME,
fileName)* to write file to destination.
*Producer URI* :
ftp://<US...@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.



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by Grzegorz Grzybek <gr...@gmail.com>.
I've just started to test it ;)

~Grzegorz

2015-06-12 15:52 GMT+02:00 Himanshu Mittal <hi...@gmail.com>:

> With tempPrefix as well as  with tempFileName a new connection is being
> created for each file transfer.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768134.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

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

Posted by Himanshu Mittal <hi...@gmail.com>.
With tempPrefix as well as  with tempFileName a new connection is being
created for each file transfer.



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768134.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by yogu13 <yo...@gmail.com>.
Nice!!

Just a thought can you try using the tempPrefix instead of tempFileName, i
see the tempFileName is a constant name provided and hope that it isn't
running into locking issues

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768122.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by Himanshu Mittal <hi...@gmail.com>.
Temporary file name (Camel property : tempFileName )is creating new
connection for each file transfer.



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768121.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by yogu13 <yo...@gmail.com>.
Hi,

I would suggest adding one property at a time to the endpoint and narrowing
it down to the property which is causing it. In case this hasn't been done.

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768120.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by Grzegorz Grzybek <gr...@gmail.com>.
Thanks
I'll look at it soon

regards
Grzegorz

2015-06-11 14:41 GMT+02:00 Himanshu Mittal <hi...@gmail.com>:

> We faced this issue in *camel 2.12*. I tested the same with *camel 2.14* .
> Still I see connection being opened for each temp file.
>
> Created below JIRA for same
> CAMEL-8860 <https://issues.apache.org/jira/browse/CAMEL-8860>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768099.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

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

Posted by Himanshu Mittal <hi...@gmail.com>.
We faced this issue in *camel 2.12*. I tested the same with *camel 2.14* .
Still I see connection being opened for each temp file. 

Created below JIRA for same
CAMEL-8860 <https://issues.apache.org/jira/browse/CAMEL-8860>  




--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768099.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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

Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hello Himanshu

What version of camel do you use? There was a fix for leaked connection in
case of auth failures, but this looks like another issue.
Could you create JIRA ticket, attaching information about your
route/endpoint URI?

regards
Grzegorz Grzybek

2015-06-11 13:02 GMT+02:00 Himanshu Mittal <hi...@gmail.com>:

> When we remove tempFileName from uri , FTP connections are not exhausted .
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768097.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

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

Posted by Himanshu Mittal <hi...@gmail.com>.
When we remove tempFileName from uri , FTP connections are not exhausted . 



--
View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768097.html
Sent from the Camel - Users mailing list archive at Nabble.com.