RFR: 8300268 : ServerImpl allows too many idle connections when using sun.net.httpserver.maxIdleConnections [v2]
Darragh Clarke
duke at openjdk.org
Tue Feb 7 14:49:30 UTC 2023
On Tue, 7 Feb 2023 14:22:52 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java line 966:
>>
>>> 964:
>>> 965: void markIdle(HttpConnection c) {
>>> 966: Boolean close = false;
>>
>> IIRC a connection can be marked idle temporarily if we don't receive data just right after accepting the connection. New connections created in this way should probably not cause idle connections (which have finished their work) to be closed, and that's possibly what is being observed here. If it is then I'd have to agree that the fix is probably not in the right place - or that we may need to revisit how we handled 'new' connections that have never been used.
>
> Also please don't use `Boolean` but `boolean`
> New connections created in this way should probably not cause idle connections (which have finished their work) to be closed, and that's possibly what is being observed here.
If I'm understanding correctly, the new connection would be closed instead of the existing idle connection if the idle connection limit has been reached
-------------
PR: https://git.openjdk.org/jdk/pull/12413
More information about the net-dev
mailing list