Bug 49527 - parallel timeout does not stop execution
Summary: parallel timeout does not stop execution
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: nightly
Hardware: Macintosh All
: P2 normal (vote)
Target Milestone: 1.8.2
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 01:27 UTC by Anthony Chivetta
Modified: 2010-10-25 10:06 UTC (History)
0 users



Attachments
Minimal testcase. (326 bytes, application/octet-stream)
2010-06-30 01:39 UTC, Anthony Chivetta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Chivetta 2010-06-30 01:27:56 UTC
When running something like the following: 

  <parallel timeout="2000">
       <sequential>
            <echo message="1" />
            <sleep seconds="10" />
            <echo message="2" />
       </sequential>
  </parallel>

I get the output (using ant 1.8.0 or 1.8.2alpha):

    test:
         [echo] 1
         [echo] 2

  BUILD FAILED
  build.xml:7: Parallel execution timed out

However, I expect (using ant 1.7.1):

  test:
       [echo] 1
  
  BUILD FAILED
  build.xml:7: Parallel execution timed out

The documentation of <parallel> describes the timeout option as "Number of milliseconds before execution is terminated."  This would seem to agree with the ant 1.7.1 behavior where execution of the <sequential> block is terminated upon timeout and the remaining <echo> elements are not executed.  I have attached a minimal build.xml file that demonstrates this bug.
Comment 1 Anthony Chivetta 2010-06-30 01:39:30 UTC
Created attachment 25666 [details]
Minimal testcase.
Comment 2 Stefan Bodewig 2010-10-25 10:06:00 UTC
In my case I do get both messages but the parallel is terminated after two
seconds.

Some changes to fix bug 42924 tries to interrupt the spawned threads a few
times prior to killing them.  This terminates the sleep task and makes the
second echo task start.

The changed code in svn revision 1027125 will not allow tasks to go ahead
if a timeout occured or failOnAny is true.