RFR: 8231516: network QuickAckTest.java failed due to "SocketException: maximum number of DatagramSockets reached"

Chris Hegarty chris.hegarty at oracle.com
Fri Nov 22 16:35:10 UTC 2019



> On 22 Nov 2019, at 15:09, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> 
> Hi,
> 
> Please find below a trivial fix for:
> 8231516: network QuickAckTest.java failed due to
>         "SocketException: maximum number of DatagramSockets reached"
> https://bugs.openjdk.java.net/browse/JDK-8231516
> 
> The test should be run in /othervm mode to avoid being impacted by
> other tests that might be running (or might have been running) in the
> agent VM.

I think your changes are fine (it will protect this test from others).

QuickAckTest only creates one DatagramSocket and one MulticastSocket, so
just consumes two UDP socket resources. Prior tests run in the same VM
must be consuming the majority of UDP socket resources ( and not
releasing them), then this test just happens to be the unlucky one that
hits the limit, right? So we may end up playing whack-a-mole on these
tests for a while, as needed. Maybe all tests creating UDP sockets
should be run in othervm? But that might be a bit unnecessary.

-Chris.

> best regards,
> 
> -- daniel
> 
> --- old/test/jdk/jdk/net/Sockets/QuickAckTest.java	2019-11-22 15:03:25.000000000 +0000
> +++ new/test/jdk/jdk/net/Sockets/QuickAckTest.java	2019-11-22 15:03:25.000000000 +0000
> @@ -26,7 +26,7 @@
>  * @bug 8145635
>  * @summary Add TCP_QUICKACK socket option
>  * @modules jdk.net
> - * @run main QuickAckTest
> + * @run main/othervm QuickAckTest
>  */
> import java.io.IOException;
> import java.net.DatagramSocket;



More information about the net-dev mailing list