Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MultiSubnetFailover parallel connect fails if one address errors immediately (managed SNI)

Đã đóng
#4,928 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@cheenamalhotra đang làm issue này rồi.

Từ ngày 27/10/2026.

  • #4929 của @cheenamalhotra — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Describe the bug

With MultiSubnetFailover=true, managed SNI (SniTcpHandle.ParallelConnect) connects to all resolved addresses in parallel. If one address fails immediately on Socket.Connect (any error other than WouldBlock, e.g. HostUnreachable, NetworkUnreachable, AddressFamilyNotSupported), the exception escapes the loop:

  • The whole connection fails, even when another address is reachable.
  • Sockets already created are not disposed.

Common case: a host resolves to IPv4 + IPv6, and the client has no IPv6 route (containers, VPNs, some cloud networks).

This matters more once MSF is on by default (#4876, #4927).

To reproduce

Call ParallelConnect with [<unreachable address>, 127.0.0.1] where a listener is on the loopback port. It throws instead of returning the loopback socket.

Expected behavior

Skip addresses that fail immediately, keep trying the rest, and dispose every non-selected socket on all exit paths.

Further technical details

Microsoft.Data.SqlClient: main
.NET: 10.0 (managed SNI; Unix, or Windows with managed networking)

Ngôn ngữ chính
C#
Star
1k
Fork
352
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
87

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/SqlClient

Tất cả issue của dotnet/SqlClient

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.