ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darrell DeBoer <>
Subject [myrmidon] Logging fails after <exec> task; patch with possible solution.
Date Thu, 21 Feb 2002 06:53:52 GMT

I've just started playing around with the myrmidon Ant2 proposal, as I'm 
hoping to get involved. While running a few of the sample targets, I noticed 
that after any <exec> task, no further messages are logged. This is due to 
the fact that o.a.aut.nativelib.impl.ProcessMonitor is shutting down all 
streams after the Process has been executed.  Because 
o.a.myrmidon.framework.Execute.executeNativeProcess() is passing in 
System.out, this is being closed, preventing any further messages to the 

The supplied patch fixes this by making the code that creates the Stream 
responsible for closing them. I added a flag to ProcessMonitor to optionally 
force it close the Streams when the Process terminates, but I would imagine 
that this would be only used for monitoring an asynchronous Process.

However, an alternative would be to make the ExecManager.execute() contract 
clearly specify that all Streams will be closed, and make sure that 
o.a.myrmidon.framework.Execute.executeNativeProcess() doesn't pass in 
System.out, but instead passes in an OutputStream that can be safely closed.

If the latter is a preferable solution, I'd be happy to do up a patch for 

View raw message