Skip to content

Conversation

@apoorvdeshmukh
Copy link
Contributor

@apoorvdeshmukh apoorvdeshmukh commented Dec 15, 2025

Description

Ports #3841 to release/6.0

Issues

AB#41016

Guidelines

Please review the contribution guidelines before submitting a pull request:

@apoorvdeshmukh apoorvdeshmukh requested a review from a team as a code owner December 15, 2025 16:20
Copilot AI review requested due to automatic review settings December 15, 2025 16:20
@apoorvdeshmukh apoorvdeshmukh changed the title Port #3841 to [6.0] Port #3841 to release/6.0 Dec 15, 2025
@apoorvdeshmukh apoorvdeshmukh added this to the 6.0.5 milestone Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ports feature #3841 to the release/6.0 branch, introducing a new AppContext switch EnableMultiSubnetFailoverByDefault that allows users to configure the default value of the MultiSubnetFailover connection string property. The change enables applications to opt-in to using MultiSubnetFailover=true by default, which provides faster connection times in multi-subnet environments through parallel IP connection attempts.

  • Added new AppContext switch EnableMultiSubnetFailoverByDefault with default value of false
  • Changed MultiSubnetFailover default from compile-time constant to runtime-configurable value
  • Added test coverage for the new switch

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
LocalAppContextSwitches.cs Adds the new EnableMultiSubnetFailoverByDefault property following the established Tristate lazy initialization pattern
DbConnectionStringCommon.cs Changes MultiSubnetFailover default from const bool to static readonly bool referencing the new switch
SqlConnectionString.cs Updates MultiSubnetFailover default to static readonly bool for consistency with DbConnectionStringDefaults
LocalAppContextSwitchesTests.cs Adds test case verifying the new switch defaults to false

The implementation follows the established patterns in the codebase for AppContext switches and maintains backwards compatibility by defaulting to false. The changes are consistent across all modified files and properly tested.

@paulmedynski paulmedynski self-assigned this Dec 15, 2025
@David-Engel David-Engel changed the title [6.0] Port #3841 to release/6.0 [6.0] Port #3841 Introduce app context switch for setting MSF=true by default Dec 15, 2025
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.75%. Comparing base (fd34d5e) to head (a00f7fb).
⚠️ Report is 1 commits behind head on release/6.0.

Files with missing lines Patch % Lines
...icrosoft/Data/SqlClient/LocalAppContextSwitches.cs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/6.0    #3852      +/-   ##
===============================================
- Coverage        63.68%   62.75%   -0.94%     
===============================================
  Files              285      285              
  Lines            59152    59160       +8     
===============================================
- Hits             37673    37126     -547     
- Misses           21479    22034     +555     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 68.08% <85.71%> (+0.15%) ⬆️
netfx 63.81% <85.71%> (-1.48%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants