RFR: JDK-8025211 - Intermittent test failure: java/net/DatagramSocket/PortUnreachable.java

Mark Sheppard mark.sheppard at oracle.com
Fri Nov 29 16:10:20 UTC 2013

Hi Daniel,

Thanks for the feedback.
That's a fair point about the Thread construction.
In addressing the issue, I took a minimalist approach and
mainly homed in on the Thread.sleep prior to the server send,
as the potential culprit.
As the intermittent failure is on the client DatagramSocket receive.

I think it's worth restructuring the test to avoid how it uses "this" 
for thread construction.


On 29/11/2013 15:40, Daniel Fuchs wrote:
> Hi Mark,
> Using a CountDownLatch looks like the right thing to do
> indeed.
> At first I thought that the instance variables would need
> to be declared volatile - or synchronized - but since they're
> set before the new Thread is created and not changed afterwards
> I guess it's OK.
> It's a bit strange to pass 'this' to another thread before
> 'this' is fully constructed though. Well - it's just a test ;-)
> best regards,
> -- daniel
> On 11/29/13 3:21 PM, Mark Sheppard wrote:
>> Hi
>> please oblige and review the following changes
>> http://cr.openjdk.java.net/~msheppar/8025211/webrev/
>> which address the issue raised in the bug
>> https://bugs.openjdk.java.net/browse/JDK-8025211
>> an intermittent failure occurs on some windows test machines.
>> this replaces a Thread.sleep(5000) with explicit synchronization between
>> sender
>> and receiver via a CountDownLatch
>> regards
>> Mark

More information about the core-libs-dev mailing list