[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: Re: RFR(M): 8028474: sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh
From: Staffan Larsen <staffan.larsen () oracle ! com>
Date: 2014-06-26 11:22:13
Message-ID: 3E657906-6D57-4B13-AF71-DB0EB15F4C48 () oracle ! com
[Download RAW message or body]
Indentation around JavaProcess.getId() is weird.
JavaProcess.getPid/setPid/pid do not appear to be used.
JavaProcess.waitForRemoval: How about using timestamps (currentTimeMillis()) before \
the loop and for each iteration to determine if the timeout has expired (instead of \
"time+=100”)?
nit: missing empty line before line 139, method releaseStarted().
/Staffan
On 26 jun 2014, at 00:56, Erik Gahlin <erik.gahlin@oracle.com> wrote:
> It didn't work.
>
> There's no termination notification, if I use Process#destroyForcibly(). I believe \
> the hsperfdata file is left behind so it will not be able to detect that the \
> process has died.
> Here is an updated version that renames some variable/methods.
>
> http://cr.openjdk.java.net/~egahlin/8028474_3/
>
> Thanks
> Erik
>
> Erik Gahlin skrev 2014-06-18 09:37:
> > Didn't know about destroyForcibly(). I could try that.
> >
> > Erik
> >
> > Staffan Larsen skrev 18/06/14 09:26:
> > > Erik,
> > >
> > > How about using Process.destroyForcibly() as a means to terminate the process \
> > > instead of using files for signaling?
> > > /Staffan
> > >
> > > On 17 jun 2014, at 23:13, Erik Gahlin <erik.gahlin@oracle.com> wrote:
> > >
> > > > Yes, very weird
> > > >
> > > > Could have been that I needed the tools.jar in the child processes, or it \
> > > > could have been something else. If I remember correctly, I got a CNF that I \
> > > > didn't get with the shell script, but it was few months back.
> > > > Anyway, I retried with JPRT and now it works without the shell script.
> > > >
> > > > http://cr.openjdk.java.net/~egahlin/8028474_2/
> > > >
> > > > Erik
> > > >
> > > > Staffan Larsen skrev 2014-06-16 13:49:
> > > > >
> > > > > On 16 jun 2014, at 12:32, Erik Gahlin <erik.gahlin@oracle.com> wrote:
> > > > >
> > > > > > Yekaterina Kantserova skrev 13/06/14 12:59:
> > > > > > > Erik,
> > > > > > >
> > > > > > > is there some reason why we need to keep MonitorVmStartTerminate.sh? \
> > > > > > > I've moved the JTreg header to MonitorVmStartTerminate.java
> > > > > > Hi Katja,
> > > > > >
> > > > > > That's how I did the test initially, and it works locally, but I could \
> > > > > > never get it to work in JPRT without the shell script. I believe the \
> > > > > > tools.jar is not on the class path.
> > > > >
> > > > > That is weird. I see other tests that depend in tools.jar and they work \
> > > > > fine.
> > > > > /Staffan
> > > > >
> > > > >
> > > > > >
> > > > > > Erik
> > > > > > >
> > > > > > > /*
> > > > > > > * @test
> > > > > > > * @bug 4990825
> > > > > > > * @summary attach to external but local JVM processes
> > > > > > > * @library /lib/testlibrary
> > > > > > > * @build jdk.testlibrary.*
> > > > > > > * @run main MonitorVmStartTerminate
> > > > > > > */
> > > > > > >
> > > > > > > and the test works just fine.
> > > > > > >
> > > > > > > The JTreg run contains all pathes and system properties \
> > > > > > > MonitorVmStartTerminate.sh tries to construct: ${JAVA} ${TESTVMOPTS} \
> > > > > > > -Dtest.jdk=${TESTJAVA} -Dtest.classes=${TESTCLASSES} -classpath ${CP} \
> > > > > > > MonitorVmStartTerminate
> > > > > > > See the log attached.
> > > > > > >
> > > > > > > Note @build jdk.testlibrary.* instead of @build \
> > > > > > > jdk.testlibrary.ProcessTools to make sure all testlibrary classes are \
> > > > > > > compiled to the right place when running tests concurrently.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Katja (Not a Reviewer)
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 06/12/2014 12:37 AM, Erik Gahlin wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Could I have a review of a test that has been failing
> > > > > > > > intermittently. The test now uses files for synchronization
> > > > > > > > instead of waiting for a process that sleeps.
> > > > > > > >
> > > > > > > > Webrev:
> > > > > > > > http://cr.openjdk.java.net/~egahlin/8028474/
> > > > > > > >
> > > > > > > > Bug:
> > > > > > > > https://bugs.openjdk.java.net/browse/JDK-8028474
> > > > > > > >
> > > > > > > > Description:
> > > > > > > >
> > > > > > > > The test starts ten Java processes, each with a unique id.
> > > > > > > >
> > > > > > > > Each process creates a file named after the id and then it waits for
> > > > > > > > the test to remove the file, at which the Java process exits.
> > > > > > > >
> > > > > > > > The processes are monitored by the test to make sure notifications
> > > > > > > > are sent when processes are started/terminated.
> > > > > > > >
> > > > > > > > To avoid Java processes being left behind, in case of an unexpected
> > > > > > > > failure, shutdown hooks are registered that remove files when the \
> > > > > > > > test exits. If files are not removed, i.e. due to a JVM crash,
> > > > > > > > the Java processes will exit themselves after 1000 s.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > > Erik
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
[Attachment #3 (unknown)]
<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;">Indentation around JavaProcess.getId() \
is weird.<div><br></div><div>JavaProcess.getPid/setPid/pid do not appear to be \
used.</div><div><br></div><div>JavaProcess.waitForRemoval: How about using timestamps \
(currentTimeMillis()) before the loop and for each iteration to determine if the \
timeout has expired (instead of "time+=100”)?</div><div><br></div><div>nit: missing \
empty line before line 139, method \
releaseStarted().</div><div><br></div><div>/Staffan</div><div><br><div><br><div><div>On \
26 jun 2014, at 00:56, Erik Gahlin <<a \
href="mailto:erik.gahlin@oracle.com">erik.gahlin@oracle.com</a>> wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">It didn't work. <br>
<br>
There's no termination notification, if I use
Process#destroyForcibly(). I believe the hsperfdata file is left
behind so it will not be able to detect that the process has died.<br>
<br>
Here is an updated version that renames some variable/methods.<br>
<br>
<a class="moz-txt-link-freetext" \
href="http://cr.openjdk.java.net/~egahlin/8028474_3/">http://cr.openjdk.java.net/~egahlin/8028474_3/</a><br>
<br>
Thanks<br>
Erik<br>
<br>
Erik Gahlin skrev 2014-06-18 09:37:<br>
</div>
<blockquote cite="mid:53A141B9.5000403@oracle.com" type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div class="moz-cite-prefix">Didn't know about destroyForcibly().
I could try that.<br>
<br>
Erik<br>
<br>
Staffan Larsen skrev 18/06/14 09:26:<br>
</div>
<blockquote cite="mid:5E3DE5CC-ED99-4D5A-8922-B867AB059ED5@oracle.com" \
type="cite"> <meta http-equiv="Context-Type" content="text/html;
charset=iso-8859-1">
Erik,
<div><br>
</div>
<div>How about using Process.destroyForcibly() as a means to
terminate the process instead of using files for signaling?</div>
<div><br>
</div>
<div>/Staffan</div>
<div> <br>
<div>
<div>On 17 jun 2014, at 23:13, Erik Gahlin <<a moz-do-not-send="true" \
href="mailto:erik.gahlin@oracle.com">erik.gahlin@oracle.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>
<div class="moz-cite-prefix">Yes, very weird<br>
<br>
Could have been that I needed the tools.jar in the
child processes, or it could have been something else.
If I remember correctly, I got a CNF that I didn't get
with the shell script, but it was few months back.<br>
<br>
Anyway, I retried with JPRT and now it works without
the shell script.<br>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext" \
href="http://cr.openjdk.java.net/%7Eegahlin/8028474_2/">http://cr.openjdk.java.net/~egahlin/8028474_2/</a><br>
<br>
Erik<br>
<br>
Staffan Larsen skrev 2014-06-16 13:49:<br>
</div>
<blockquote \
cite="mid:1F79073E-B42B-4791-9699-D5F3EFF92618@oracle.com" type="cite"> <br> <div>
<div>On 16 jun 2014, at 12:32, Erik Gahlin <<a \
moz-do-not-send="true" \
href="mailto:erik.gahlin@oracle.com">erik.gahlin@oracle.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>
<div class="moz-cite-prefix">Yekaterina
Kantserova skrev 13/06/14 12:59:<br>
</div>
<blockquote cite="mid:539AD9AE.2050309@oracle.com" \
type="cite"> <div class="moz-cite-prefix">Erik,<br>
<br>
is there some reason why we need to keep
MonitorVmStartTerminate.sh? I've moved the
JTreg header to MonitorVmStartTerminate.java<br>
</div>
</blockquote>
Hi Katja,<br>
<br>
That's how I did the test initially, and it
works locally, but I could never get it to work
in JPRT without the shell script. I believe the
tools.jar is not on the class path.<br>
</div>
</blockquote>
<div><br>
</div>
<div>That is weird. I see other tests that depend in
tools.jar and they work fine.</div>
<div><br>
</div>
<div>/Staffan</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div> <br>
Erik<br>
<blockquote cite="mid:539AD9AE.2050309@oracle.com" \
type="cite"> <div class="moz-cite-prefix"> <br>
/*<br>
* @test<br>
* @bug 4990825<br>
* @summary attach to external but local JVM
processes<br>
* @library /lib/testlibrary<br>
* @build jdk.testlibrary.*<br>
* @run main MonitorVmStartTerminate<br>
*/<br>
<br>
and the test works just fine.<br>
<br>
The JTreg run contains all pathes and system
properties MonitorVmStartTerminate.sh tries
to construct:<br>
${JAVA} ${TESTVMOPTS} -Dtest.jdk=${TESTJAVA}
-Dtest.classes=${TESTCLASSES} -classpath
${CP} MonitorVmStartTerminate<br>
<br>
See the log attached.<br>
<br>
Note <b>@build jdk.testlibrary.*</b>
instead of <b>@build
jdk.testlibrary.ProcessTools</b> to make
sure all testlibrary classes are compiled <br>
to the right place when running tests
concurrently.<br>
<br>
Thanks,<br>
Katja (Not a Reviewer)<br>
<br>
<br>
<br>
On 06/12/2014 12:37 AM, Erik Gahlin wrote:<br>
</div>
<blockquote cite="mid:5398DA16.7090200@oracle.com" \
type="cite">Hi, <br> <br>
Could I have a review of a test that has
been failing <br>
intermittently. The test now uses files for
synchronization <br>
instead of waiting for a process that
sleeps. <br>
<br>
Webrev: <br>
<a moz-do-not-send="true" class="moz-txt-link-freetext" \
href="http://cr.openjdk.java.net/%7Eegahlin/8028474/">http://cr.openjdk.java.net/~egahlin/8028474/</a>
<br>
<br>
Bug: <br>
<a moz-do-not-send="true" class="moz-txt-link-freetext" \
href="https://bugs.openjdk.java.net/browse/JDK-8028474">https://bugs.openjdk.java.net/browse/JDK-8028474</a>
<br>
<br>
Description: <br>
<br>
The test starts ten Java processes, each
with a unique id. <br>
<br>
Each process creates a file named after the
id and then it waits for <br>
the test to remove the file, at which the
Java process exits. <br>
<br>
The processes are monitored by the test to
make sure notifications <br>
are sent when processes are
started/terminated. <br>
<br>
To avoid Java processes being left behind,
in case of an unexpected <br>
failure, shutdown hooks are registered that
remove files when the test <br>
exits. If files are not removed, i.e. due
to a JVM crash, <br>
the Java processes will exit themselves
after 1000 s. <br>
<br>
Thanks <br>
Erik <br>
</blockquote>
<br>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</blockquote>
<br>
</div>
</blockquote></div><br></div></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic