JDK 9 RFR of JDK-8143610: (dc) java/nio/channels/DatagramChannel/AdaptDatagramSocket.java failed intermittently due to SocketTimeoutException

Alan Bateman Alan.Bateman at oracle.com
Tue Mar 8 10:57:00 UTC 2016



On 04/03/2016 13:05, Hamlin Li wrote:
> Please review the patch for test 
> java/nio/channels/DatagramChannel/AdaptDatagramSocket.java
>
> It's a test issue. By launch lots threads to exhaust cpu and network 
> bandwidth, the issue could be reproduced locally with timeout value as 
> 1000 millisecond ( timeout value in test code is 15000 millisecond ).
> Root cause: Test success depends on a specific timeout value, but in a 
> extremely busy system, it's understandable that socket r/w can not 
> finish in before timeout, so java.net.SocketTimeoutException will be 
> thrown.
> Solution: Should not assume the socket operation could be finished in 
> a specific time, just set the timeout as max value.
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8143610
> webrev: http://cr.openjdk.java.net/~mli/8143610/webrev.00/
15s seems very high but the system is swapping or something is looping 
then you might be right. So I think the change is okay, I can sponsor 
this for you.

-Alan.


More information about the nio-dev mailing list