Skip to content

Enable UseOverallConnectTimeoutForPoolWait by default in 8.0 #4642

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area\Connection PoolingUse this label to tag issues that apply to problems with connection pool.

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions