Skip to content

Refactor connection timeout and connection admission; reduce idle timeout#33

Merged
szeka9 merged 1 commit into
mainfrom
development
Jul 7, 2026
Merged

Refactor connection timeout and connection admission; reduce idle timeout#33
szeka9 merged 1 commit into
mainfrom
development

Conversation

@szeka9

@szeka9 szeka9 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Remove HttpServer.can_handle_new_client() responsible for evicting stale/inactive connections. Idle connection timeout is already part of the HTTP connection handling logic (see also HttpConnection.RECV_TIMEOUT_SECONDS).

Instead, use the availibility of the buffer pool as the admission control mechanism, and wait for each connection to reserve a sender and receiver buffer pair.

Make BaseConnection.close() idempontent, and allow the close method to be called multiple times during error handling for example. In such cases, BaseConnection.close() returns immediately instead of rerunning cleanup steps.

Reduce idle timeout from 10 seconds to 3 seconds.
This allows other clients to wait less for available stream buffers.

Additional changes:

  • move client removal to the end of the finally branch
  • remove HttpServer._drop_client() and make it inline, as it is only referenced in one place
  • update description of class variables in HttpConnection

…eout

Remove HttpServer.can_handle_new_client() responsible
for evicting stale/inactive connections. Idle connection
timeout is already part of the HTTP connection handling logic
(see also HttpConnection.RECV_TIMEOUT_SECONDS).

Instead, use the availibility of the buffer pool as the
admission control mechanism, and wait for each connection
to reserve a sender and receiver buffer pair.

Make BaseConnection.close() idempontent, and allow the
close method to be called multiple times during error
handling for example. In such cases, BaseConnection.close()
returns immediately instead of rerunning cleanup steps.

Reduce idle timeout from 10 seconds to 3 seconds.
This allows other clients to wait less for available
stream buffers.

Additional changes:
- move client removal to the end of the finally branch
- remove HttpServer._drop_client() and make it inline,
as it is only referenced in one place
- update description of class variables in HttpConnection
@szeka9 szeka9 merged commit 5feb999 into main Jul 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant