Skip to content

Conversation

@tomaswolf
Copy link
Member

IoSessions are created asynchronously through an IoConnector. When an IoConnector is closed, all sessions created through it are also to be closed.

Because session creation is asynchronous, it was possible that a newly created session registered on an already closed IoConnector, and then would never be closed.

Prevent this by forcibly closing any newly created IoSession if the IoConnector is already closed when the new session tries to register with the connector.

Add a test that verifies that the connect future the client code sees does not provide a session but is fulfilled either by an exception or by having been cancelled.

Fixes #663.

@tomaswolf tomaswolf force-pushed the gh-663 branch 6 times, most recently from f89022a to c334bad Compare March 1, 2025 17:24
IoSessions are created asynchronously through an IoConnector. When an
IoConnector is closed, all sessions created through it are also to be
closed.

Because session creation is asynchronous, it was possible that a newly
created session registered on an already closed IoConnector, and then
would never be closed.

Prevent this by forcibly closing any newly created IoSession if the
IoConnector is already closed when the new session tries to register
with the connector.

Add a test that verifies that the connect future the client code sees
does not provide a session but is fulfilled either by an exception or
by having been cancelled.
@tomaswolf tomaswolf merged commit 0fed512 into apache:master Mar 1, 2025
7 checks passed
@tomaswolf tomaswolf deleted the gh-663 branch March 1, 2025 19:53
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.

TCP connection leakage issue when using the remote port forwarding feature

1 participant