This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
[release/3.0] Fix Connection Resiliency in SqlClient #42615
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Port of: dotnet/runtime#62 and dotnet/SqlClient#310
Summary
Connection Resiliency is an important feature in System.Data.SqlClient which stopped working post PR
#34047 as a breaking change got introduced.
Customer Impact
Connections once idle cannot be restored and users start getting exceptions "The connection is closed".
Regression?
Yes. Regression was introduced in System.Data.SqlClient v4.7.0-preview.19073.11.
Testing
This feature was not being tested in CI hence the bug flowed over. We are working on adding tests in dotnet/sqlclient to test this feature and ensure it doesn't escape in future. Since all new changes will be made in dotnet/sqlclient repository, we'll be adding tests there in future.
Risk
Low: The fix is to unwrap
Task.Factory.StartNew
call which was modified fromTask.Run
, has been tested and verified.cc: @danmosemsft @David-Engel