Skip to content

Enable UseOverallConnectTimeoutForPoolWait by default in 8.0 #4642

Closed
0 of 1 issue completed
Closed

Description

@mdaigle

Is your feature request related to a problem? Please describe.

Switch.Microsoft.Data.SqlClient.UseOverallConnectTimeoutForPoolWait currently defaults to false for compatibility. As a result, pool waits and subsequent network operations can each receive a fresh Connect Timeout budget, allowing SqlConnection.Open and OpenAsync to exceed the caller's configured overall timeout.

The switch was introduced in #4270 to opt into propagating one timeout budget through connection pooling. Related issue #4582 tracks remaining in-open round trips that also need to honor that budget.

Describe the solution you'd like

Change Switch.Microsoft.Data.SqlClient.UseOverallConnectTimeoutForPoolWait to default to true in Microsoft.Data.SqlClient 8.0. Explicitly setting the switch to false should retain the legacy behavior as a compatibility escape hatch.

Update the switch documentation and tests to cover:

  • The new default value.
  • Explicit false preserving legacy pool-wait timeout behavior.
  • Sync and async connection-opening paths.
  • Both WaitHandleDbConnectionPool and ChannelDbConnectionPool where applicable.

Describe alternatives you've considered

Keep the default at false and require applications to opt in. This preserves existing behavior but leaves the configured Connect Timeout unable to act as one overall connection-opening budget by default.

Additional context

This is an intentional default behavior change for the 8.0 major release. The current switch definition and tests assert a default of false.

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    Area\Connection Pooling
    on Sep 3, 2026
  2. added this to the 8.0.0 milestone on Sep 3, 2026
  3. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

  4. github-actions commented on Sep 17, 2026

    @github-actions

    🔍 Triage Summary (on-demand re-triage)

    Check Result
    Issue type Feature
    Environment Not applicable (feature request, no repro/environment fields required)
    Area Area\Connection Pooling
    Duplicates None found (closely related, non-duplicate: #4270 introduced the switch; #4582 tracks remaining in-open round trips honoring the same budget)
    Regression Not applicable — this is an intentional default-behavior change proposal for 8.0, not a regression report

    Analysis

    This is a well-scoped feature request to flip the default of Switch.Microsoft.Data.SqlClient.UseOverallConnectTimeoutForPoolWait from false to true in the 8.0 major release, so Connect Timeout acts as a single overall budget across pool wait and subsequent network operations by default. The switch and its current false default already exist in LocalAppContextSwitches.cs (confirmed), with existing coverage in WaitHandleDbConnectionPoolBudgetTest.cs, SqlConnectionInternalTimeoutTests.cs, and LocalAppContextSwitchesTest.cs. The request explicitly calls for updating both the switch default and its tests/docs. Severity/priority: P2 (planned intentional breaking behavior change tied to the 8.0 milestone, not a bug).

    Next Steps

    • Since this is a scoped, milestone-tagged (8.0.0) feature request with clear acceptance criteria, recommend assigning to Copilot coding agent to: (1) flip the default in LocalAppContextSwitches.cs for UseOverallConnectTimeoutForPoolWaitString, (2) update existing tests in WaitHandleDbConnectionPoolBudgetTest.cs, SqlConnectionInternalTimeoutTests.cs, and LocalAppContextSwitchesTest.cs to assert the new default while adding explicit-false legacy-behavior coverage, and (3) update features.instructions.md and any switch documentation to reflect the new default.
    • Ensure both sync and async connection-opening paths, and both WaitHandleDbConnectionPool and ChannelDbConnectionPool (where applicable), are covered by the updated tests as requested.
    • Given this is an intentional breaking default change, ensure the PR description calls it out clearly for release notes and changelog visibility (per release-notes workflow), since it affects timeout behavior for all consumers not explicitly setting the switch.
    • Consider cross-referencing Connect timeout propagated through pool #4270 and SqlConnectionInternal starts a fresh ConnectTimeout for in-open round trips instead of honoring the caller's remaining timeout #4582 in the implementing PR for full context.

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for #4642 · copilot · auto · 50.3 AIC · ⌖ 13.5 AIC · ⊞ 11.9K · ◷

  5. changed the issue type fromtoon Sep 18, 2026
  6. moved this from To triage to Backlog in SqlClient Boardon Sep 18, 2026
  7. modified the milestones: 8.0.0, 8.0.0-preview1 on Sep 18, 2026
  8. changed the title [-]Enable UseOverallConnectTimeoutForPoolWait by default in 8.0[/-] [+]Enable UseOverallConnectTimeoutForPoolWait by default in 8.1[/+] on Oct 20, 2026
  9. mdaigle commented on Oct 20, 2026

    @mdaigle
    ContributorAuthor

    Moving to 8.1. We should gather usage stats first to ensure we've driven enough traffic through the flag.

  10. cheenamalhotra commented on Oct 26, 2026

    @cheenamalhotra
    Member

    Can we do it in 8.0.0 instead - since it can be seen as a breaking change / backwards-incompatible as it's a change of default behavior.

    I think this is the right thing to do, and if anyone prefers the old behavior can turn it back off.

  11. modified the milestones: 8.1.0-preview1, 8.0.0 on Oct 26, 2026
  12. Copilot commented on Nov 10, 2026

    Copilot
    Contributor

    The agent encountered an error and was unable to start working on this issue: Please try again later, or contact support if the problem persists. (Request id: E6E9:178842:5DE508:89D790:6AF365C2)

  13. changed the title [-]Enable UseOverallConnectTimeoutForPoolWait by default in 8.1[/-] [+]Enable UseOverallConnectTimeoutForPoolWait by default in ~~8.1~~ 8.0[/+] on Nov 10, 2026
  14. changed the title [-]Enable UseOverallConnectTimeoutForPoolWait by default in ~~8.1~~ 8.0[/-] [+]Enable UseOverallConnectTimeoutForPoolWait by default in 8.0[/+] on Nov 10, 2026
  15. moved this from Backlog to In progress in SqlClient Boardon Nov 10, 2026
  16. moved this from In progress to Done in SqlClient Boardon Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area\Connection Pooling

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions