Background
This is a follow-up to #1188 , where we identified two problems:
Issue 1 (tracked in #1188): No limit on max concurrent connections — addressed by the max_connections() workaround PR.
Issue 2 (this ticket): Connection (and its underlying socket/FD) is constructed before async_accept completes, meaning every pending accept already holds an open FD.
The Proper Fix
The construction of the Connection should be done inside of the async_accept block; FD needs to be created later.
Background
This is a follow-up to #1188 , where we identified two problems:
Issue 1 (tracked in #1188): No limit on max concurrent connections — addressed by the max_connections() workaround PR.
Issue 2 (this ticket): Connection (and its underlying socket/FD) is constructed before async_accept completes, meaning every pending accept already holds an open FD.
The Proper Fix
The construction of the Connection should be done inside of the async_accept block; FD needs to be created later.