On Tue, 7 Feb 2023 14:49:27 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 two additional 
> commits since the last revision:
> 
>  - use right boolean
>  - addressed comment and made test less strict

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

> 109:         int idleConnectionCount = 
> HttpServerAccess.getIdleConnectionCount(server);
> 110:         System.out.println("count " + idleConnectionCount);
> 111:         assertTrue(maxIdleConnections >= idleConnectionCount);

It would be good to add an error message showing the value of both quantities. 
Pity that there is no `assertLte` or `assertGte`.

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

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

Reply via email to