Hi, we have some discussion going on in Bugzilla that we probably need to pull together at a single place.
[BTW since minotaur is down I haven't received any mails to @apache.org for several hours which includes most of my mailing lists subscriptions so I may already have missed a separate thread.] In order to fix Bug 5003 StreamPumper gained the useAvailable flag that made it use a timed and interruptable read on input streams because sometimes a process on Windows doesn't close its streams once it finishes (the streams are handed down to child processes which keep them open and useAvailable detaches Ant from those child processes). There is an AntUnit test for this in trunk: exec-test testDoesntWaitForChildren which silently fails on Windows if you set useAvailable to false. It fails if the test takes longer than 20 seconds, it should finish in about three. [Next sidenote, we will probably need to add a timing assertion to AntUnit to make the test fail not-so-silently]. A side effect of this is that now each execution on Windows takes at least the amount of time we wait for joining threads. Currently 200ms. This makes tasks that perform many small executions like attrib a lot slower than they used to be. I don't see any workaround here. This was bug 48734. In the meantime bug 48746 was fixed by setting useAvailable to true outside of Windows as well, which brings bug 48734 to other OSes as well - bug 49384. It also seems to cause problems for NetBeans, see Jesse's comments in bug 48746. And then there is bug 46805 which claims that even useAvailable=true doesn't fix a hanging process on Windows and suggests that we destroy the process instance and not close the process' streams explicitly at all. I have no test cases for this bug and can't reproduce it myself. process.destroy makes Ant lose output from the forked process, so it doesn't seem a viable option. Not closing the streams doesn't seem to do any harm on Windows but I can't confirm that it helps in any way. I did see some issues on the only Linux box I can reach right now, but that may be due to other problems (other exec stuff fails there as well). If fiddling with useAvailable doesn't seem to be a decent approach maybe there must be a completely different route to take. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
