Skip to content

Conversation

edwardneal
Copy link
Contributor

This contains the preparatory work for the merge of SqlInternalConnectionTds. We're working with a smaller code file here, so I've merged every part of the two files which avoids a behavioural change.

This should be easier to review comment-by-comment - it's bulky, but not complex. I'd also appreciate a CI run.

At the end of this, the diff is +43/-80. Remaining differences here are:

  • Optimisation: netcore will clear the array of session state when the connection resets, netfx will replace it with a new array.
  • netfx will consider four extra error codes from the server to be transient: 40020, 40143, 40166, 40540.
  • netfx contains a little context connection support.
  • netfx contains support for Transparent Network IP Resolution, while netcore does not.
  • netfx supports the Network Library connection string parameter.
  • netcore will throw an exception if it receives an ENV_LOGSHIPNODE ENVCHANGE when the connection string's Application Intent is read-only, while netfx will not.
  • When getting the federated authentication token, netfx will stop retrying if the next pause between each attempt to acquire a token would cause the connection timeout to be expired.
  • netcore supports passing the User ID parameter to MSAL as an initial username; netfx does not.
  • Some exception messages are more precise in netfx than they are in netcore.

What should we do with Transparent Network IP Resolution? This functionality doesn't exist in netcore at all - does it need to be ported? If it only exists in netfx for backwards compatibility, should it be made obsolete?

I'd also be interested to know what the right style of exception messages is. If (for example) the connection receives an unexpected session recovery feature extension acknowledgement, which exception message should I merge in favour of?

Internal connection fatal error. Error state: {ParsingErrorState}, Feature Id: {ID of feature}.

Internal connection fatal error.

The former is netfx, the latter is netcore. I prefer the detail of netfx, but I imagine netcore changed this for a reason.

@benrr101
Copy link
Contributor

benrr101 commented May 5, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me, my only comments are probably out of scope since the overall goal is to align the two codebases, not necessarily clean them up. Feel free to address or ignore and comment on my comments.

@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label May 5, 2025
@benrr101 benrr101 added this to the 6.1-preview2 milestone May 5, 2025
Copy link

codecov bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 65.05376% with 65 lines in your changes missing coverage. Please review.

Project coverage is 62.15%. Comparing base (08622e7) to head (9fda691).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
...crosoft/Data/SqlClient/SqlInternalConnectionTds.cs 45.00% 33 Missing ⚠️
...crosoft/Data/SqlClient/SqlInternalConnectionTds.cs 74.19% 32 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (08622e7) and HEAD (9fda691). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (08622e7) HEAD (9fda691)
addons 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3323       +/-   ##
===========================================
- Coverage   75.42%   62.15%   -13.28%     
===========================================
  Files         262      292       +30     
  Lines       41241    65263    +24022     
===========================================
+ Hits        31106    40562     +9456     
- Misses      10135    24701    +14566     
Flag Coverage Δ
addons ?
netcore 66.50% <45.90%> (-8.80%) ⬇️
netfx 60.62% <74.40%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Thanks for looking at the comments - looking forward to getting this merged 🚀 🚢

@benrr101
Copy link
Contributor

benrr101 commented May 7, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@benrr101 benrr101 merged commit dc1298a into dotnet:main May 16, 2025
237 checks passed
@edwardneal edwardneal deleted the merge/sqlinternalconnectiontds-preparation branch May 16, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Project 🚮 Things that relate to the common project project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants