Triage for dotnet/runtime#117548.
Repo filter: All networking issues.
MihuBot version: 4431de.
Ping MihaZupan for any issues.
This is a test triage report generated by AI, aimed at helping the triage team quickly identify past issues/PRs that may be related.
Take any conclusions with a large grain of salt.
dotnet/runtime#117548: [API Proposal]: ValueTask-based Socket.ConnectAsync overloads for Happy Eyeballs by antonfirsov
[Tool] Searching for ValueTask ConnectAsync Socket, Happy Eyeballs Socket, SocketsHttpHandler ConnectAsync ValueTask, ConnectAlgorithm Socket API proposal, Socket.ConnectAsync overloads (IncludeOpen=True, IncludeClosed=True, IncludeIssues=True, IncludePullRequests=True, Repository=dotnet/runtime)
[Tool] Found 82 issues, 168 comments, 82 returned results (5493 ms)
Here are the most relevant related issues, proposals, and discussions for issue #117548: "[API Proposal]: ValueTask-based Socket.ConnectAsync overloads for Happy Eyeballs":
- Summary: This is the original API proposal to add Happy Eyeballs support to
Socket.ConnectAsync, introducing the ConnectAlgorithm enum and a new SAEA-based overload. The discussion includes feedback on API shape, enum naming, and the rationale for making Happy Eyeballs a general Socket feature rather than just for SocketsHttpHandler.
- Key comments:
- Triage and feedback on API design, including parameter order and enum naming.
- Noted that this would enable SocketsHttpHandler to use Happy Eyeballs, but did not propose Task/ValueTask-based overloads at the time.
- Summary: This issue tracks the implementation of the API approved in #861, specifically the SAEA-based overload with
ConnectAlgorithm. It notes that only the SAEA path is supported and suggests that Task/ValueTask-based overloads would be useful for broader scenarios.
- Key comments:
- Community interest in having this for .NET 10.
- Triage note (June 2025): Unlikely to be completed for 10.0.
- Summary: This mega-issue tracks all approved and implemented Socket API changes, including the Happy Eyeballs SAEA overload and ValueTask-based overloads for cancellation. It notes that Task-based
ConnectAlgorithm overloads were not proposed, which is now being raised as a gap.
- Key comments:
- @antonfirsov (Feb 2022): Asks why Task-based
ConnectAlgorithm overloads were not proposed.
- @scalablecory: Suggests this was an oversight.
- @liveans (Jun 2023): Most work is done; remaining Happy Eyeballs work is tracked in #87932.
- Summary: Proposal and approval for ValueTask-based overloads of
ConnectAsync and AcceptAsync with CancellationToken. This is the foundation for the modern async Socket APIs, but does not include ConnectAlgorithm or Happy Eyeballs.
- Key comments:
- API review video and notes.
- These overloads are now implemented and in use.
- Summary: Implements the ValueTask-based overloads for
ConnectAsync and AcceptAsync with CancellationToken, as tracked in #921 and #33418. Does not add Happy Eyeballs/ConnectAlgorithm support to these overloads.
- Key comments:
- Discussion about code duplication and platform-specific behavior.
- @antonfirsov notes Windows-specific concerns and the need for careful cancellation handling.
- Summary: The original motivation for Happy Eyeballs in SocketsHttpHandler. The issue documents the need for fallback from IPv6 to IPv4 and the lack of such logic in SocketsHttpHandler compared to curl. It led to the generalization of Happy Eyeballs support in Socket APIs.
- Key comments:
- Detailed investigation and reproduction of the problem.
- Discussion of platform differences and the need for parallel connection attempts.
- Summary: Implements the SAEA-based Happy Eyeballs API approved in #87932. Notes that only SAEA is supported and suggests considering Task-based support in the future.
- Key comments:
- Discussion about risk mitigation and test complexity.
- Suggestion to extend support to Task-based APIs.
- Summary: Tracks the finalization of Socket API upgrades, including the addition of
ConnectAlgorithm overloads to ValueTask-based APIs. The proposal includes the exact overloads suggested in #117548.
- Key comments:
- Proposal for ValueTask-based
ConnectAsync overloads with ConnectAlgorithm for Socket, TcpClient, and extension methods.
- Discussion about API symmetry and discoverability.
- Summary: Reports that
Socket.ConnectAsync(EndPoint, CancellationToken) does not pass the cancellation token to the DNS query, which can cause resource exhaustion in high-concurrency scenarios. This is relevant for any new overloads that perform DNS resolution.
- Key comments:
- Detailed call stack analysis.
- Suggestion that new overloads should ensure proper cancellation propagation.
- Summary: Discusses optimizations for
Socket.ConnectAsync when the input is already an IP address, to avoid unnecessary DNS resolution. Relevant for overloads that take DnsEndPoint or IPAddress[].
- Summary: Tracks the SAEA-based implementation and notes the need for ValueTask-based overloads for broader use, including SocketsHttpHandler.
- Summary: Proposes a new
TcpConnection (or TcpStream) API with modern async methods, including options for connection algorithms like Happy Eyeballs. Suggests that future APIs should expose these options in a user-friendly way.
Summary of Conclusions
- The SAEA-based Happy Eyeballs API (
ConnectAsync with ConnectAlgorithm) is approved and implemented, but only for SAEA.
- There is clear demand and rationale for ValueTask-based overloads with
ConnectAlgorithm, both for SocketsHttpHandler and general use.
- The lack of these overloads is acknowledged as an oversight in previous API reviews (#33418).
- There is community and team support for adding these overloads, and the proposal in #117548 aligns with the direction discussed in #33417 and #63162.
- When implementing, care should be taken to ensure proper cancellation propagation (see #92054).
- The proposal is a logical and needed extension to the current API set, and would enable SocketsHttpHandler and other consumers to use Happy Eyeballs without code duplication.
In summary:
The proposal in #117548 is well-motivated, fills a known gap, and is supported by previous discussions and API reviews. The main related issues are #861, #87932, #33418, #33417, and #63162, all of which point to the need for ValueTask-based ConnectAsync overloads with ConnectAlgorithm for full Happy Eyeballs support in both SocketsHttpHandler and general Socket usage.
Triage for dotnet/runtime#117548.
Repo filter: All networking issues.
MihuBot version:
4431de.Ping MihaZupan for any issues.
This is a test triage report generated by AI, aimed at helping the triage team quickly identify past issues/PRs that may be related.
Take any conclusions with a large grain of salt.
Here are the most relevant related issues, proposals, and discussions for issue #117548: "[API Proposal]: ValueTask-based Socket.ConnectAsync overloads for Happy Eyeballs":
1. Issue #861 (Oct 2019) - Happy Eyeballs support in Socket.ConnectAsync
Socket.ConnectAsync, introducing theConnectAlgorithmenum and a new SAEA-based overload. The discussion includes feedback on API shape, enum naming, and the rationale for making Happy Eyeballs a generalSocketfeature rather than just forSocketsHttpHandler.2. Issue #87932 (Jun 2023) - Happy Eyeballs support in Socket.ConnectAsync
ConnectAlgorithm. It notes that only the SAEA path is supported and suggests that Task/ValueTask-based overloads would be useful for broader scenarios.3. Issue #33418 (Mar 2020) - Socket API changes mega-issue
ConnectAlgorithmoverloads were not proposed, which is now being raised as a gap.ConnectAlgorithmoverloads were not proposed.4. Issue #921 (Apr 2019) - Add CancellationToken overloads to Socket.ConnectAsync and Socket.AcceptAsync
ConnectAsyncandAcceptAsyncwithCancellationToken. This is the foundation for the modern async Socket APIs, but does not includeConnectAlgorithmor Happy Eyeballs.5. PR #40750 (Aug 2020) - implement ConnectAsync overloads with CancellationToken on Socket and TcpClient
ConnectAsyncandAcceptAsyncwithCancellationToken, as tracked in #921 and #33418. Does not add Happy Eyeballs/ConnectAlgorithm support to these overloads.6. Issue #26177 (May 2018) - Consider using Happy Eyeballs or similar in SocketsHttpHandler
7. PR #106374 (Aug 2024) - add support for parallel Connect
8. Issue #33417 (Mar 2020, closed Jul 2024) - Finalize Socket API upgrade
ConnectAlgorithmoverloads to ValueTask-based APIs. The proposal includes the exact overloads suggested in #117548.ConnectAsyncoverloads withConnectAlgorithmforSocket,TcpClient, and extension methods.9. Issue #92054 (Sep 2023, closed Jul 2024) - Socket.ConnectAsync(EndPoint, CT) does not pass CT to DNS query
Socket.ConnectAsync(EndPoint, CancellationToken)does not pass the cancellation token to the DNS query, which can cause resource exhaustion in high-concurrency scenarios. This is relevant for any new overloads that perform DNS resolution.10. Issue #1480 (Jan 2018, closed Jun 2021) - Socket.ConnectAsync could optimize better for IP addresses
Socket.ConnectAsyncwhen the input is already an IP address, to avoid unnecessary DNS resolution. Relevant for overloads that takeDnsEndPointorIPAddress[].11. PR #87932 (Jun 2023) - Happy Eyeballs support in Socket.ConnectAsync
12. Issue #63162 (Dec 2021) - [API Proposal]: Simple, modern TCP APIs
TcpConnection(orTcpStream) API with modern async methods, including options for connection algorithms like Happy Eyeballs. Suggests that future APIs should expose these options in a user-friendly way.Summary of Conclusions
ConnectAsyncwithConnectAlgorithm) is approved and implemented, but only for SAEA.ConnectAlgorithm, both for SocketsHttpHandler and general use.In summary:
The proposal in #117548 is well-motivated, fills a known gap, and is supported by previous discussions and API reviews. The main related issues are #861, #87932, #33418, #33417, and #63162, all of which point to the need for ValueTask-based
ConnectAsyncoverloads withConnectAlgorithmfor full Happy Eyeballs support in both SocketsHttpHandler and general Socket usage.