🤖
Describe the bug
Please verify that acquisitions interrupted by ChannelDbConnectionPool shutdown report shutdown rather than a pool timeout, and correct any paths that misclassify the failure.
This is a focused follow-up to #4714. PR #4718 addresses the wait-handle pool only.
Current evidence: ChannelDbConnectionPool.GetInternalConnection already catches ChannelClosedException and throws InvalidOperationException with SQL_ConnectionPoolShutDown: “The connection pool has been shut down.” Its OperationCanceledException handler reports ADP.PooledOpenTimeout(). A channel-pool timeout misclassification has not yet been reproduced.
Source: ChannelDbConnectionPool.cs.
To reproduce
No confirmed channel-specific repro yet. Please add deterministic coverage with Switch.Microsoft.Data.SqlClient.UseConnectionPoolV2 enabled:
- Hold all available pool capacity and park another acquisition.
- Call
ClearPool or ClearAllPools before its connection timeout expires.
- Verify the acquisition reports shutdown, not a pool timeout.
Cover both Open and OpenAsync, including shutdown while an async acquisition is scheduled but has not started. Keep separate coverage for genuine timeout expiration and caller cancellation.
The workload in #4714 can also guide investigation with the channel-pool switch enabled.
Expected behavior
- Shutdown-interrupted acquisitions report the existing shutdown-specific error rather than suggesting pool exhaustion or an elapsed timeout.
- Genuine timeouts retain their timeout error.
- Caller cancellation retains its existing behavior.
If all relevant paths already behave correctly, add regression coverage and document that finding rather than changing the error handling unnecessarily.
Further technical details
Microsoft.Data.SqlClient version: current source at 153f8793e6672816ce6a0652fdae4ea21708b5ad; affected released versions not established.
.NET target: not yet reproduced.
SQL Server version: not yet reproduced.
Operating system: not yet reproduced.
Additional context
Related: #4302, #4714, #4718.
Scope is error classification and regression coverage only. Allowing admitted channel-pool acquisitions to finish after shutdown, adding replacement-pool retries, and redesigning channel lifetime are out of scope.
🤖
Describe the bug
Please verify that acquisitions interrupted by
ChannelDbConnectionPoolshutdown report shutdown rather than a pool timeout, and correct any paths that misclassify the failure.This is a focused follow-up to #4714. PR #4718 addresses the wait-handle pool only.
Current evidence:
ChannelDbConnectionPool.GetInternalConnectionalready catchesChannelClosedExceptionand throwsInvalidOperationExceptionwithSQL_ConnectionPoolShutDown: “The connection pool has been shut down.” ItsOperationCanceledExceptionhandler reportsADP.PooledOpenTimeout(). A channel-pool timeout misclassification has not yet been reproduced.Source: ChannelDbConnectionPool.cs.
To reproduce
No confirmed channel-specific repro yet. Please add deterministic coverage with
Switch.Microsoft.Data.SqlClient.UseConnectionPoolV2enabled:ClearPoolorClearAllPoolsbefore its connection timeout expires.Cover both
OpenandOpenAsync, including shutdown while an async acquisition is scheduled but has not started. Keep separate coverage for genuine timeout expiration and caller cancellation.The workload in #4714 can also guide investigation with the channel-pool switch enabled.
Expected behavior
If all relevant paths already behave correctly, add regression coverage and document that finding rather than changing the error handling unnecessarily.
Further technical details
Microsoft.Data.SqlClient version: current source at
153f8793e6672816ce6a0652fdae4ea21708b5ad; affected released versions not established..NET target: not yet reproduced.
SQL Server version: not yet reproduced.
Operating system: not yet reproduced.
Additional context
Related: #4302, #4714, #4718.
Scope is error classification and regression coverage only. Allowing admitted channel-pool acquisitions to finish after shutdown, adding replacement-pool retries, and redesigning channel lifetime are out of scope.