Summary: | [PATCH] Add Ftp ant task timeout | ||
---|---|---|---|
Product: | Ant | Reporter: | Chuchi <chuchiperriman> |
Component: | Optional Tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | eugene.adell |
Priority: | P3 | Keywords: | PatchAvailable |
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | patch introducing a reading timeout for FTP |
Description
Chuchi
2009-06-24 02:22:55 UTC
I am working with Ant FTP to transfer (GET) files from a website. To minimize traffic, the depends="yes" and retriesAllowed="5" is set. Still, the ant ftp task hangs on some files and the task does not continue. The script hangs (for hours, days). Assuming that this problem is related to timeouts, I also would love to see this feature implemented. There are reported implementations (as a "hack"): http://evgeny-goldin.com/blog/ant-ftp-task-progress-indicator-timeout/ Created attachment 36473 [details]
patch introducing a reading timeout for FTP
the attachment is in text format
Short Description
Introduce a read timeout, then receiving files which look infinite will not hang anymore. Sending is not concerned, as timeout will already occur if necessary.
Tests
It should be tested seriously, as FTP is not the most simple thing, and because we rely on external library (commons-net).
My tests are OK for now, but maybe do you have servers to test against.
What the patch does :
. Introduce the dataTimeout as suggested by a comment, which will make impossible any infinite reading (described as 'FTP hangs' by many)
. Call the abort command when the timeout is detected, then the server will be notified it should stop sending the current file. This abort is not sent in any urgent mode as described by RFC 959, as the commons-net doesn't support this feature yet. Although the effects are unsure since all servers are not implemented the same way, this feature is here to be compliant with the RFC.
Patch as provided manually verified and applied. I also updated the docs |