On Tue, 7 Feb 2023 15:40:48 GMT, Darragh Clarke <[email protected]> wrote:

>> Currently there is a race condition that can allow for too many 
>> 'idleConnections' in `ServerImpl`
>> 
>> This PR adds a lock to make sure only one connection can be marked Idle at a 
>> time as well as a test that consistently failed before the change but which 
>> now passes.
>
> Darragh Clarke has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   addressed comments

test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java line 
85:

> 83:         try (final ExecutorService requestIssuer = 
> Executors.newFixedThreadPool(totalConnections)) {
> 84:             for (int i = 1; i <= totalConnections; i++) {
> 85:                 final URL requestURL = new URL("http://"; + host + ":" + 
> port + "/MaxIdleConnectionTest/" + i);

I suspect we will have to use the `URIBuilder` from the test utility to take 
into account IPv6 host addresses which can contain a `:` in the string. In this 
case we would use it something like:

URL url = URIBuilder.newBuilder()
                    .scheme("http")
                    .loopback()
                    .port(port)
                    .path("/MaxIdleConnectionTest/" + i)
                    .toURL();
....

-------------

PR: https://git.openjdk.org/jdk/pull/12413

Reply via email to