ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <>
Subject RE: [PATCH] ExecuteWatchdog
Date Wed, 31 Jan 2001 11:35:46 GMT
> -----Original Message-----
> From: Stefan Bodewig []
> (1) please try to keep indentation and whitespace as is, I've had a
> hard time to figure out what had actually changed in some of your
> patches (not necessarily this one).

Sorry, my editor was set to replace space as tab, we had problems recently
due to source code that had different indent type  as spaces.

> (2) I've commented out the assertion for retCode != 0 in
> ExecuteWatchdogTest.test.testTimeout. In my environment IBM JDK
> 1.3/Linux this fails - will investigate it further.

interesting... on Win NT 4.0 I tried on both Sun JDK1.2.2 and JDK1.3 it runs
I downloaded the pre release IBM JDK 1.3 and it does not even have the same
behavior you describe.
Here it fails on testFailed on the killedProcess assertion. (??)

Considering what you said I believe this a return code problem between Linux
and Windows...but obviously here it should not be 0, right ?

Will investigate this another problem too asap. Even though at first sight
it looks like waitFor does not behave the same way when i'm throwing an
exception right away from the process. It takes over 2 secs to execute
(which is over the timeout and thus would explain the killedProcess flag)
while it takes 150/250ms using Sun JVMs.

This indicates a bug in my code anyway. I didn't check first if the process
is terminated before actually killing it. So if the process terminates
before the timeout and that you ask the watchdog after the timeout, it will
report that it killed it.
Should be something like:

            // if we are here, either someone stopped the watchdog,
            // we are on timeout and the process must be killed, or
		// we are on timeout and the process has already stopped.
            try {
            	// We must check if the process was not stopped
            	// before being here
            } catch (IllegalThreadStateException e){
			// the process is not terminated, if this is really
			// a timeout and not a manual stop then kill it.
			if (watch){
                		killedProcess = true;

Another interesting thing is that reflection seems to return methods in the
opposite order of the JVMs from Sun. (has nothing to do but interesting fact

 St├ęphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - 
 Disclaimer: All the opinions expressed above are mine and not those from my

View raw message