RFR: 8024055: serviceability/attach/AttachWithStalePidFile.java createJavaPidFile() fails

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Mon Oct 27 09:31:09 UTC 2014


Hi Peter,

On 10/24/2014 03:39 PM, Peter Allwin wrote:
> Hello!
>
> This patch fixes two intermittent issues seen over the past year:
>
>    a) Possible failure where an existing pid-file is not owned by the
> test user
>    b) Race during startup where we try to attach to the target before
> it’s ready (removed arbitrary 5sec sleep)
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8024055
> Webrev: http://cr.openjdk.java.net/~allwin/8024055/webrev.00/

test/serviceability/attach/AttachWithStalePidFile.java
---
Couldn't you use ProcessTools.startProcess(name, processBuilder, 
readyPredicate) to start the test process and make sure it prints 
"ready" line before continuing?


test/serviceability/attach/AttachWithStalePidFileTarget.java
---
Instead of waiting here for a really long time you could block on 
reading from stdin. The driver application would then just send a 
shutdown message over pipe when it is safe for the test application to die.

-JB-

>
> Tested locally on my Mac.
>
> Thanks!
> /peter



More information about the serviceability-dev mailing list