ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: errors in <parallel> tasks
Date Wed, 24 Sep 2003 23:54:07 GMT
On Thu, 25 Sep 2003 09:27 am, Alan Bram wrote:
> I love the <parallel> task. I use it in the conventional way:
>
>   <parallel>
>     <run my J2EE server>
>     <wait for server to come up, run tests, then shut down server>
>   </parallel>
>
> What troubles me is that if anything goes wrong, and I don't successfully
> reach and execute the "shut down" part, the server never finishes, and thus
> my build hangs forever.  There doesn't seem to be any way to interrupt the
> "run server" thread from the failing other thread.
>
> Am I missing something here?
>
> I care about this because I'm setting up Cruise Control on this build/test
> cycle.  Maybe I should also ask the Cruise Control community.
>

In addition to try-catch mentioned, you can use new features of <parallel> in 
Ant 1.6 to give you more control in an unattended build. <parallel> now 
supports a timeout attribute which will terminate the task execution after a 
given amount of time. Also a failonany attribute will fail the task if any of 
the parallel tasks fails without waiting for all tasks to complete.

Note that any early termination of the <parallel> task will not forcibly halt 
the remaining threads - these continue to run until they either end naturally 
or the System.exit() cleans the whole lot up.

Finally <parallel> also supports a <daemon> nested element to allow unattended

servers to be started in the build. 

Conor


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message