Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/IceRpc/Transports/Tcp/Internal/TcpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@ internal TcpClientConnection(
}
catch (SocketException exception)
{
Socket.Dispose();
Dispose();

@bernardnormier bernardnormier Sep 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not covering those on purpose. new Socket fails only when the process can't create a socket at all, and with the default pool a dropped rental is garbage collected. The server path needs a pool whose Rent throws, which the default pool never does for our segment sizes. This is the fix we want for #4828.

throw exception.ToIceRpcException();
}
catch
{
Socket.Dispose();
Dispose();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test for this one: the leak is observable only through a pool built to count rentals, and the fix is two lines.

throw;
}
}
Expand Down