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

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8046883 com/sun/jdi/ProcessAttachTest.sh gets "java.io.IOException: Invalid process identif
From:       Staffan Larsen <staffan.larsen () oracle ! com>
Date:       2014-06-23 8:33:56
Message-ID: AAAD2855-6911-41C8-97AE-FC51C4220CC4 () oracle ! com
[Download RAW message or body]

Fancy!

new review: http://cr.openjdk.java.net/~sla/8046883/webrev.01/

/Staffan

On 18 jun 2014, at 13:59, Peter Allwin <peter.allwin@oracle.com> wrote:

> This looks a lot better!
> 
> (Since we’re using fancy new features we could use streams to find the connector \
> instance) 
> AttachingConnector ac = Bootstrap.virtualMachineManager().attachingConnectors()
> .stream()
> .filter(c -> c.name().equals("com.sun.jdi.ProcessAttach"))
> .findFirst()
> .orElseThrow(() -> new RuntimeException("Unable to locate \
> ProcessAttachingConnector")); 
> Thanks!
> /peter
> 
> On 17 Jun 2014, at 19:46, Staffan Larsen <staffan.larsen@oracle.com> wrote:
> 
> > Here is a rewrite of the test in Java instead of a shell script. Should be easier \
> > to maintain. 
> > webrev: http://cr.openjdk.java.net/~sla/8046883/webrev.00/
> > 
> > Thanks,
> > /Staffan
> > 
> > On 17 jun 2014, at 15:12, Staffan Larsen <staffan.larsen@oracle.com> wrote:
> > 
> > > 
> > > On 17 jun 2014, at 15:03, Alan Bateman <Alan.Bateman@oracle.com> wrote:
> > > 
> > > > On 17/06/2014 13:35, Staffan Larsen wrote:
> > > > > > 
> > > > > 
> > > > > It could be a timing issue, but in the other direction. If cygwin hasn’t \
> > > > > yet started the real windows process when I run ps, then maybe ps will not \
> > > > > list it. But given the “sleep 2” before the ps invocation, the process \
> > > > > should have had time to started. No guarantees of course. 
> > > > > Making the sleep shorter will not help as the process we are starting will \
> > > > > not terminate until we tell it to. 
> > > > > 
> > > > Okay, although what I was suggesting is to use your patch but additionally \
> > > > move the sleep at L79 into the new while loop so that it doesn't spin quickly \
> > > > through the 10 iterations. That would give the test 10 attempts (and 10 \
> > > > seconds) to get the pid.
> > > 
> > > Ah, I see. I misunderstood your comment.
> > > 
> > > I started looking at rewriting the test in pure Java instead of the shell \
> > > script. With the new Process.getPid() this looks like the best approach. I’ll \
> > > come back with a new review request soon. 
> > > /Staffan
> > 
> 


[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;">Fancy!<div><br></div><div>new review: \
<a href="http://cr.openjdk.java.net/~sla/8046883/webrev.01/">http://cr.openjdk.java.ne \
t/~sla/8046883/webrev.01/</a></div><div><br></div><div>/Staffan</div><div><br><div><div>On \
18 jun 2014, at 13:59, Peter Allwin &lt;<a \
href="mailto:peter.allwin@oracle.com">peter.allwin@oracle.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite"><meta \
http-equiv="Content-Type" content="text/html charset=windows-1252"><div \
style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space;">This looks a lot better!<div><br></div><div>(Since we’re using \
fancy new features we could use streams to find the connector \
instance)</div><div><br></div><div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;AttachingConnector ac = \
Bootstrap.virtualMachineManager().attachingConnectors()</div><div style="margin: 0px; \
font-size: 11px; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
.stream()</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .filter(c -&gt; c.name().equals(<span \
style="color: #d12f1b">"com.sun.jdi.ProcessAttach"</span>))</div><div style="margin: \
0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
.findFirst()</div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .orElseThrow(() -&gt; <span \
style="color: #bb2ca2">new</span> RuntimeException(<span style="color: \
#d12f1b">"Unable to locate \
ProcessAttachingConnector"</span>));</div><div><br></div><div>Thanks!</div><div>/peter</div><div><br></div><div><div>On \
17 Jun 2014, at 19:46, Staffan Larsen &lt;<a \
href="mailto:staffan.larsen@oracle.com">staffan.larsen@oracle.com</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta \
http-equiv="Content-Type" content="text/html charset=windows-1252"><div \
style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space;">Here is a rewrite of the test in Java instead of a shell script. \
Should be easier to maintain.<div><br></div><div>webrev: <a \
href="http://cr.openjdk.java.net/~sla/8046883/webrev.00/">http://cr.openjdk.java.net/~ \
sla/8046883/webrev.00/</a></div><div><br></div><div><div>Thanks,</div><div>/Staffan</div></div><div><br><div><div>On \
17 jun 2014, at 15:12, Staffan Larsen &lt;<a \
href="mailto:staffan.larsen@oracle.com">staffan.larsen@oracle.com</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div \
style="font-size: 16px; font-style: normal; font-variant: normal; font-weight: \
normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: \
start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; \
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On 17 jun 2014, at 15:03, \
Alan Bateman &lt;<a href="mailto:Alan.Bateman@oracle.com">Alan.Bateman@oracle.com</a>&gt; \
wrote:<br><br><blockquote type="cite">On 17/06/2014 13:35, Staffan Larsen \
wrote:<br><blockquote type="cite">:<br><br>It could be a timing issue, but in the \
other direction. If cygwin hasn’t yet started the real windows process when I run ps, \
then maybe ps will not list it. But given the “sleep 2” before the ps invocation, the \
process should have had time to started. No guarantees of course.<br><br>Making the \
sleep shorter will not help as the process we are starting will not terminate until \
we tell it to.<br><br><br></blockquote>Okay, although what I was suggesting is to use \
your patch but additionally move the sleep at L79 into the new while loop so that it \
doesn't spin quickly through the 10 iterations. That would give the test 10 attempts \
(and 10 seconds) to get the pid.<br></blockquote><br>Ah, I see. I misunderstood your \
comment.<br><br>I started looking at rewriting the test in pure Java instead of the \
shell script. With the new Process.getPid() this looks like the best approach. I’ll \
come back with a new review request \
soon.<br><br>/Staffan</div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></body></html>




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

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