Bug 52076 - Add delay to retry task
Summary: Add delay to retry task
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.2
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: 1.8.3
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 13:23 UTC by Arjan Veenstra
Modified: 2012-02-01 12:47 UTC (History)
0 users



Attachments
Intial patch (1.76 KB, application/octet-stream)
2011-10-24 13:23 UTC, Arjan Veenstra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arjan Veenstra 2011-10-24 13:23:10 UTC
Created attachment 27839 [details]
Intial patch

I wanted the retry task to wait a bit before retrying. Since I didn't find a clean way to do this I patched the retry task to support a 'retryDelay' attribute. This simply sets the time to sleep between different retry attempts. We currently use this on our build server to retry SVN updates which might fail because multiple jobs are updating the same sandbox concurrently. So far it's been working fine.
 
The attached patch has only been compiled/tested against java 1.6, but I guess it should be fine in older versions as well.
 
The output, when a retryDelay is set looks like this:
updateLib:
     [echo] Start library update...
      [svn] svn: Working copy 'C:\BuildSystem\Libraries' locked; try performing 'cleanup'
      [svn] svn: Working copy 'C:\BuildSystem\Libraries' locked; try performing 'cleanup'
      [svn] <Update> failed.
    [retry] Attempt [0]: error occurred; retrying after 1000 ms...
      [svn] svn: Working copy 'C:\BuildSystem\Libraries' locked; try performing 'cleanup'
      [svn] svn: Working copy 'C:\BuildSystem\Libraries' locked; try performing 'cleanup'
      [svn] <Update> failed.
    [retry] Attempt [1]: error occurred; retrying after 1000 ms...
     [echo] Update done...
Comment 1 Arjan Veenstra 2011-10-24 13:23:47 UTC
I might update the patch which an increasing delay if there's a use for that.
Comment 2 Stefan Bodewig 2011-12-06 16:34:22 UTC
A slightly modified version of the patch is in as svn revision 1211004

It would be nice if you could add a patch for the manual and maybe even a test as well.
Comment 3 Stefan Bodewig 2012-02-01 12:47:46 UTC
added documentation with svn revision 1239108