On Tue, 7 Feb 2023 14:51:01 GMT, Daniel Fuchs <[email protected]> wrote:
>>> 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
>
> That's what I'm worried about - but I haven't analyzed the code deeply - just
> working from memory.
The dispatcher has a comment about this actually, note the last sentence
* - NEWLY_ACCEPTED: A connection is marked as newly accepted as soon as the
Dispatcher
* accept()s a connection. A newly accepted connection is added to a
newlyAcceptedConnections
* collection. A newly accepted connection also gets added to the
allConnections collection.
* The newlyAcceptedConnections isn't checked for any size limits,
however, if the server is
* configured with a maximum connection limit, then the elements in the
* newlyAcceptedConnections will never exceed that configured limit (no
explicit size checks
* are done on the newlyAcceptedConnections collection, since the
maximum connection limit
* applies to connections across different connection states). A
connection in NEWLY_ACCEPTED
* state is considered idle and is eligible for idle connection
management.
-------------
PR: https://git.openjdk.org/jdk/pull/12413