-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to SqlServer instance with managed SNI and Timeout=0 on SqlClient 5.0 #1733
Labels
💥 Regression
Issues that are regressions introduced from earlier PRs.
🐛 Bug!
Issues that are bugs in the drivers we maintain.
Comments
Just tested, changing that part of code like this makes it work: Task<IPAddress[]> serverAddrTask = Dns.GetHostAddressesAsync(serverName);
if (isInfiniteTimeout)
{
serverAddrTask.Wait();
}
else
{
bool complete = serverAddrTask.Wait(timeout);
// DNS timed out - don't block
if (!complete)
return null;
} |
Thanks @vonzshik for bringing this to our attention. We'll have to discuss with the team and see if this is the desired behaviour or a regression and get back to you soon. |
David-Engel
added a commit
to David-Engel/SqlClient
that referenced
this issue
Aug 25, 2022
JRahnama
added
the
💥 Regression
Issues that are regressions introduced from earlier PRs.
label
Aug 25, 2022
David-Engel
added a commit
to David-Engel/SqlClient
that referenced
this issue
Aug 25, 2022
Also fix SSRP when DataSource is an IP address
David-Engel
added a commit
that referenced
this issue
Aug 30, 2022
* Fix for issue #1733 - hang on infinite timeout Also fix SSRP when DataSource is an IP address
DavoudEshtehari
pushed a commit
to DavoudEshtehari/SqlClient
that referenced
this issue
Aug 30, 2022
* Fix for issue dotnet#1733 - hang on infinite timeout Also fix SSRP when DataSource is an IP address
DavoudEshtehari
pushed a commit
to DavoudEshtehari/SqlClient
that referenced
this issue
Aug 30, 2022
* Fix for issue dotnet#1733 - hang on infinite timeout Also fix SSRP when DataSource is an IP address
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
💥 Regression
Issues that are regressions introduced from earlier PRs.
🐛 Bug!
Issues that are bugs in the drivers we maintain.
Describe the bug
While attempting to establish the connection to SqlServer instance while having
Timeout=0
in the connection string the app becomes unresponsive. I'm able to reproduce this problem on linux and windows withAppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true)
. It works fine on SqlClient 4.1.0.To reproduce
Expected behavior
SqlClient should be able to establish a connection with
Timeout=0
, just like in previous verionsFurther technical details
Microsoft.Data.SqlClient 5.0
.NET target: .NET 6.0
SQL Server version: SQL Server 2017
Operating system: CentOS 7, Windows 10
Additional context
The problem is because while waiting for the dns, the timeout passed there is the default
TimeSpan
, which is 0, and that's why it fails immediately (it should have been -1):SqlClient/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
Lines 150 to 159 in bd21d76
SqlClient/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
Line 362 in bd21d76
This was introduced in #1578.
The text was updated successfully, but these errors were encountered: