[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    RFR
From:       Jaroslav Bachorik <jaroslav.bachorik () oracle ! com>
Date:       2014-10-24 16:44:14
Message-ID: 544A81DE.8060009 () oracle ! com
[Download RAW message or body]

Please, review this change to the test library.

Issue : https://bugs.openjdk.java.net/browse/JDK-8062070
Webrev: http://cr.openjdk.java.net/~jbachorik/8062070/webrev.00

The test started failing after the process.destroyForcibly() was added 
to ProcessTools.executeProcess() to make sure there were no orphaned 
processes once the test was finished. The destruction call was placed to 
the finally block and was called for running or terminated processes 
indiscriminately.

It turns out that Process.get*Stream() methods will get confused when 
calling Process.destroy/Forcibly/() on an already exited process - the 
streams will get closed and any attempt to read or write to them will 
end with a SocketException.

The failure is timing related - when the stream manages to buffer data 
before destroying the process from another thread the test passes. 
Otherwise it just fails.

The solution is to forcibly close the external process (started by 
ProcessTools.executeProcess()) only in cases when eg. Process.waitFor() 
throws an exception - moving it from the finally block to the catch block.

Thanks,

-JB-
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic