ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Wood <kw...@i2.com>
Subject Re: Problem with parallel mode
Date Mon, 29 Oct 2001 16:31:25 GMT
I agree that the examples I gave were meant to promote
discussion, not be a final proposal, and may not
cover all the use cases.

Another aspect to consider is, how much do we want to focus
on near term fixes to the Ant 1.x stream of development vs.
discussing the best way to do it in Ant 2.x? Since Conor
added the parallel task, I'd be happy to see his proposal,
and unless there is some tremendous reason NOT to, let Conor
update parallel for Ant 1.x while we debate Ant 2.x design.

In other words, I'd like a solution this week, not 3 months
of debate (be it civil or not :^) while I continue to kludge 
this by manualing shutdown the server from another console, 
then ending the build from the command line with CTRL-C...

-ken

P.S. not meaning to start an offshoot thread, but I've
always been a proponent of keeping Ant close to its 'procedural'
roots and not become excessively 'scripty'. But I guess
there is a fine line between where procedural ends and scripting
begins. I see my '<catch>' idea as being procedural (declare
what to do in the case of a build exception), but I agree the
'kill' part looks scripty, unless you consider it a declaration
of how to end other threads under certain conditions. Maybe
<stop refid="xxx"/> would be more politically correct than 'kill' :^)

Jose Alberto Fernandez wrote:
> 
> I don't know... This looks preaty much like scripting. ;-)
> 
> I think we need to put some more thought on how do we want <parallel> and <sequential>
tasks to interact with each other and with the build process itself.
> 
> For example, what should a parallel branch of the build do when another branch receives
a BuildException?
> In a plain sequential build the only accion is to stop the build. We all know all the
discussions about whether having an "onerror" target or using buildlisteners to detect failures.
How does that discussion deals with parallelized builds?
> 
> I think we are seeing another aspect of the same issue here, but mascaraded by the fact
that we have things
> going on in parallel. And then we have the regular issues of how to manage threads in
general <join>, <kill>
> <wait>, <timelimit>, etc. Do we really need all that? Can we get most of
the same with less tasks?
> 
> I think we need to start a *nice* thread of discussion about this issues and design it
properly, as oppose to
> just try to solve the problem for particular examples. Don't get me wrong, examples are
useful to test the usefulness of a proposal, but we need to understand how all the pieces
work toguether and any other unforseen concequenses.
> 
> Thoughts?
> 
> Jose Alberto
> 
> ----- Original Message -----
> From: "Ken Wood" <kwood@i2.com>
> To: "Ant Developers List" <ant-dev@jakarta.apache.org>
> Cc: "Ant Users List" <ant-user@jakarta.apache.org>
> Sent: Monday, October 29, 2001 2:54 PM
> Subject: Re: Problem with parallel mode
> 
> > I was wrestling with a similar issue last week.
> >
> > I start weblogic in one 'parallel' branch, and run
> > test cases in another branch. When the test cases
> > end, they shutdown the server. But, sometimes the
> > test cases get hung, and the build never ends.
> >
> > I had thought of doing a "sleep hours=1" in a third branch,
> > followed by the code to stop the weblogic server. Now, in
> > the case where the branch that runs the tests against
> > the servers gets hung up for some reason, this time out
> > branch would shut down the server. But, it wouldn't stop
> > the hung test branch. And, if the test branch succeeded,
> > the 'sleep' branch would keep the build running for whatever
> > remains of the 1 hour timeout. So, I didn't pursue it...
> >
> > What I wanted was to have an 'kill' that I could use.
> > If the 'sleep' branch got to the end of the sleep, it would
> > then run the code to cleanly shutdown the server and to
> > 'kill' the hung test code. And, if the test code branch
> > finished first, it would shutdown the server cleanly (as
> > it already does) and then 'kill' the timeout branch that
> > is still sleeping. An example:
> >
> > <parallel>
> >
> >    <sequential id="server">
> >       code to start the server
> >    </sequential>
> >
> >    <sequential id="tests">
> >        code to run tests
> >        code to stop server
> >        <kill refid="sleep"/>
> >    </sequential>
> >
> >    <sequential id="sleep">
> >      <sleep hours="1"/>
> >      code to stop server
> >      <kill refid="tests"/>
> >    </sequential>
> >
> > </parallel>
> >
> > Now, to deal with the original issue raised, we need to
> > be able to catch an exception that happens when a failure
> > occurs. How about this:
> >
> > <sequential id="tests">
> >   <catch>
> >     code to stop server
> >     <kill refid="sleep"/>
> >   </catch>
> >   code to run tests
> >   code to stop server
> >   <kill refid="sleep"/>
> > </sequential>
> >
> >
> > The code declared within <catch> would only be executed if
> > a build failure exception was thrown during the running
> > of the tests.
> >
> > Conor MacNeill wrote:
> > >
> > > I'm copying this over to Ant-dev. Please follow up there
> > >
> > > Quintus, Guenter wrote:
> > >
> > > > Hi all,
> > > >
> > > > i am running ant 1.4 using the parallel tag.
> > > > Weblogic is started in one branch, in the second some test cases are
> > > > runned and there is also a stop method for the weblogic task.
> > > > But if there is an error at testing ant will still stop the execution
> > > > for branch 2 which is ok but weblogic is still running at branch 1.
> > > > Is there a way to tell ant to stop every branch in case of an error?
> > > >
> > >
> > > There are a few issues here. Firstly, this would need to be configurable
> > > I guess ("one dead - all dead" versus "dead thread does not affect other
> > > threads"). The other issue is that Ant doesn't actually know how to
> > > "stop" the Weblogic process.
> > >
> > > We could explore allowing some tasks, particularly tasks based on
> > > embedded <exec>'s to be terminated. In the case of <parallel>,
it could
> > > use Thread.interrupt() to break the waitFor() call in Execute. In that
> > > case the InterruptedException catch should forcibly terminate the
> > > process. The logic in <parallel> would need to be updated a bit too.
> > >
> > > Thoughts anyone? I'll try this out this week sometime.
> > >
> > > Conor
> > >
> > > --
> > > To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message