Enable UseOverallConnectTimeoutForPoolWait by default in 8.0
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 72
Description
### 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`.
Contributor guide
Research direction
Locate the current UseOverallConnectTimeoutForPoolWait switch definition and its existing tests, then review the sync and async connection-opening paths for both WaitHandleDbConnectionPool and ChannelDbConnectionPool. Update the documented default and coverage so the default is true, explicit false preserves legacy behavior, and both paths honor the intended cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100