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

List:       openjdk-net-dev
Subject:    Re: [12] RFR 8199931: java/net/MulticastSocket/UnreferencedMulticastSockets.java fails with
From:       Chris Hegarty <chris.hegarty () oracle ! com>
Date:       2018-09-21 6:37:20
Message-ID: D321E693-8E75-4C76-BC39-9524A00B38BE () oracle ! com
[Download RAW message or body]

Looks good. Thanks.

-Chris

> On 21 Sep 2018, at 02:51, Chris Yin <xu.y.yin@oracle.com> wrote:
> 
> Hi, Chris H
> 
> Thanks for your suggestion, changed as below to just print client bound port as you \
> mentioned. Certainly, this is not a fix, just add some debug info, hope we could \
> get next failure sample to prove the guess :) 
> New Changes:
> 
> diff -r c26fbf1434c4 \
>                 test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java
> --- a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java	Thu Sep \
>                 20 14:19:53 2018 -0700
> +++ b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java	Fri Sep \
> 21 09:45:40 2018 +0800 @@ -120,6 +120,7 @@
> thr.start();
> 
> MulticastSocket client = new MulticastSocket(0);
> +        System.out.printf("  client bound port: %d%n", client.getLocalPort());
> client.connect(svr.getHost(), svr.getPort());
> pendingSockets.add(new NamedWeak(client, pendingQueue, "clientMulticastSocket"));
> extractRefs(client, "clientMulticastSocket");
> 
> Regards,
> Chris Y
> 
> > On 20 Sep 2018, at 7:11 PM, Chris Hegarty <chris.hegarty@oracle.com> wrote:
> > 
> > Thank you for looking at this issue Chris Y.
> > 
> > I don't disagree with the changes, but if you want to confirm your
> > suspicion, that the same port is being reused, then printing out
> > the client's bound port would do that ( since the servers port is
> > already printed in the logs ). 
> > 
> > If such a change was integrated, then the next observed failure
> > would confirm or disconfirm your suspicion.
> > 
> > -Chris H.
> > 
> > > On 20 Sep 2018, at 11:50, Chris Yin <xu.y.yin@oracle.com> wrote:
> > > 
> > > Loop net-dev since the test is under java/net, thanks
> > > 
> > > > On 20 Sep 2018, at 5:30 PM, Chris Yin <xu.y.yin@oracle.com> wrote:
> > > > 
> > > > Please review below minor change for 8199931, thanks
> > > > 
> > > > A little explanation about the change here, since the failure samples are too \
> > > > less (seems too hard to repro), so below scenario which caused the failure is \
> > > > a guess. MultcastSocket constructor set reuse address true by default, when \
> > > > call "new MulticastSocket(0)" to create client socket that maybe in a little \
> > > > possibility it used same address with server, that will explain why the \
> > > > failure looks like client received data package from itself. Follow the \
> > > > guessing, I modified test code to explicit create client socket use same port \
> > > > with server, then got same failure error as reported bug on OEL7. Though I \
> > > > cannot make sure the guess is 100% match with the original failure, but at \
> > > > least we could try to prevent such possible scenario. 
> > > > bug: https://bugs.openjdk.java.net/browse/JDK-8199931
> > > > 
> > > > changes:
> > > > 
> > > > diff -r 43668e3cae4d \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > >                 \
> > > > --- a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java	Thu \
> > > >                 Sep 20 08:59:03 2018 +0200
> > > > +++ b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java	Thu \
> > > > Sep 20 16:37:36 2018 +0800 @@ -40,6 +40,7 @@
> > > > import java.net.DatagramSocket;
> > > > import java.net.DatagramSocketImpl;
> > > > import java.net.InetAddress;
> > > > +import java.net.InetSocketAddress;
> > > > import java.net.MulticastSocket;
> > > > import java.net.UnknownHostException;
> > > > import java.nio.file.Files;
> > > > @@ -119,7 +120,10 @@
> > > > Thread thr = new Thread(svr);
> > > > thr.start();
> > > > 
> > > > -        MulticastSocket client = new MulticastSocket(0);
> > > > +        MulticastSocket client = new MulticastSocket(null);
> > > > +        // prevent MulticastSocket reuse previous address, see 8199931
> > > > +        client.setReuseAddress(false);
> > > > +        client.bind(new InetSocketAddress(0));
> > > > client.connect(svr.getHost(), svr.getPort());
> > > > pendingSockets.add(new NamedWeak(client, pendingQueue, \
> > > > "clientMulticastSocket")); extractRefs(client, "clientMulticastSocket");
> > > > 
> > > > Regards,
> > > > Chris
> > > 
> > 
> 


[Attachment #3 (text/html)]

<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body dir="auto">Looks good. Thanks.<br><br><div \
id="AppleMailSignature">-Chris</div><div><br>On 21 Sep 2018, at 02:51, Chris Yin \
&lt;<a href="mailto:xu.y.yin@oracle.com">xu.y.yin@oracle.com</a>&gt; \
wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" \
content="text/html charset=utf-8"><div class="">Hi, Chris H</div><div class=""><br \
class=""></div><div class="">Thanks for your suggestion, changed as below to just \
print client bound port as you mentioned. Certainly, this is not a fix, just add some \
debug info, hope we could get next failure sample to prove the guess :)</div><div \
class=""><br class=""></div><div class="">New Changes:</div><div class=""><br \
class=""></div><span class=""><font face="Monaco" class="">diff -r c26fbf1434c4 \
test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<br class="">--- \
a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<span \
class="Apple-tab-span" style="white-space:pre">	</span>Thu Sep 20 14:19:53 2018 \
-0700<br class="">+++ \
b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<span \
class="Apple-tab-span" style="white-space:pre">	</span>Fri Sep 21 09:45:40 2018 \
+0800<br class="">@@ -120,6 +120,7 @@<br class="">&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;thr.start();<br class="">&nbsp;<br class="">&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;MulticastSocket client = new MulticastSocket(0);<br class="">+&nbsp; &nbsp; \
&nbsp; &nbsp;&nbsp;System.out.printf("&nbsp;&nbsp;client bound port: %d%n", \
client.getLocalPort());<br class="">&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;client.connect(svr.getHost(), svr.getPort());<br class="">&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp;pendingSockets.add(new NamedWeak(client, pendingQueue, \
"clientMulticastSocket"));<br class="">&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;extractRefs(client, "clientMulticastSocket");</font><br class=""></span><span \
class=""><br class=""></span><div class=""><span class="">Regards,</span></div><div \
class=""><span class="">Chris Y<br class=""></span><span class=""><br \
class=""></span><div><blockquote type="cite" class=""><div class="">On 20 Sep 2018, \
at 7:11 PM, Chris Hegarty &lt;<a href="mailto:chris.hegarty@oracle.com" \
class="">chris.hegarty@oracle.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><div class=""><div class="">Thank you for looking \
at this issue Chris Y.<br class=""><br class="">I don't disagree with the changes, \
but if you want to confirm your<br class="">suspicion, that the same port is being \
reused, then printing out<br class="">the client's bound port would do that ( since \
the servers port is<br class="">already printed in the logs ). <br class=""><br \
class="">If such a change was integrated, then the next observed failure<br \
class="">would confirm or disconfirm your suspicion.<br class=""><br class="">-Chris \
H.<br class=""><br class=""><blockquote type="cite" class="">On 20 Sep 2018, at \
11:50, Chris Yin &lt;<a href="mailto:xu.y.yin@oracle.com" \
class="">xu.y.yin@oracle.com</a>&gt; wrote:<br class=""><br class="">Loop net-dev \
since the test is under java/net, thanks<br class=""><br class=""><blockquote \
type="cite" class="">On 20 Sep 2018, at 5:30 PM, Chris Yin &lt;<a \
href="mailto:xu.y.yin@oracle.com" class="">xu.y.yin@oracle.com</a>&gt; wrote:<br \
class=""><br class="">Please review below minor change for 8199931, thanks<br \
class=""><br class="">A little explanation about the change here, since the failure \
samples are too less (seems too hard to repro), so below scenario which caused the \
failure is a guess. MultcastSocket constructor set reuse address true by default, \
when call "new MulticastSocket(0)" to create client socket that maybe in a little \
possibility it used same address with server, that will explain why the failure looks \
like client received data package from itself. Follow the guessing, I modified test \
code to explicit create client socket use same port with server, then got same \
failure error as reported bug on OEL7. Though I cannot make sure the guess is 100% \
match with the original failure, but at least we could try to prevent such possible \
scenario.<br class=""><br class="">bug: <a \
href="https://bugs.openjdk.java.net/browse/JDK-8199931" \
class="">https://bugs.openjdk.java.net/browse/JDK-8199931</a><br class=""><br \
class="">changes:<br class=""><br class="">diff -r 43668e3cae4d \
test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<br class="">--- \
a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<span \
class="Apple-tab-span" style="white-space:pre">	</span>Thu Sep 20 08:59:03 2018 \
+0200<br class="">+++ \
b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java<span \
class="Apple-tab-span" style="white-space:pre">	</span>Thu Sep 20 16:37:36 2018 \
+0800<br class="">@@ -40,6 +40,7 @@<br class="">import java.net.DatagramSocket;<br \
class="">import java.net.DatagramSocketImpl;<br class="">import \
java.net.InetAddress;<br class="">+import java.net.InetSocketAddress;<br \
class="">import java.net.MulticastSocket;<br class="">import \
java.net.UnknownHostException;<br class="">import java.nio.file.Files;<br class="">@@ \
-119,7 +120,10 @@<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread thr = new \
Thread(svr);<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thr.start();<br \
class=""><br class="">- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MulticastSocket \
client = new MulticastSocket(0);<br class="">+ \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MulticastSocket client = new \
MulticastSocket(null);<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// \
prevent MulticastSocket reuse previous address, see 8199931<br class="">+ \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client.setReuseAddress(false);<br \
class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client.bind(new \
InetSocketAddress(0));<br class=""> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client.connect(svr.getHost(), svr.getPort());<br \
class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pendingSockets.add(new \
NamedWeak(client, pendingQueue, "clientMulticastSocket"));<br class=""> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extractRefs(client, "clientMulticastSocket");<br \
class=""><br class="">Regards,<br class="">Chris<br class=""></blockquote><br \
class=""></blockquote><br class=""></div></div></blockquote></div><br \
class=""></div></div></blockquote></body></html>



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

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