Is your feature request related to a problem? Please describe.
The pool shutdown work in #4302 deferred a follow-up to simplify internal connection pool state tracking. The discussion concluded that the pools need to distinguish running from not running, rather than introduce additional lifecycle states.
The current enum-based representation also encourages checks and log messages that assume "not running" specifically means "shutting down."
Describe the solution you'd like
Replace the internal connection pool state enum with a boolean running flag, consistently across ChannelDbConnectionPool and WaitHandleDbConnectionPool.
- Update initialization, startup, shutdown, and state checks to use the boolean consistently.
- Preserve existing concurrency guarantees and shutdown behavior, including idempotency and the rule that a shut-down pool is not resurrected.
- Update associated comments and diagnostics to describe running/not-running accurately.
- Add or update tests covering both pool implementations, including synchronous and asynchronous acquisition during shutdown.
This is an internal implementation change; it must not change the public SqlConnection.State API or the System.Data.ConnectionState enum.
Describe alternatives you've considered
Retain an enum and introduce explicit lifecycle states such as Created, Starting, Started, Stopping, and Stopped. This was discussed in #4302, but the follow-up direction was to use a boolean without introducing new states.
Additional context
Source: User Story 45932: Changing ConnectionState from enum to bool.
Related PR: #4302 — Implement pool shutdown for ChannelDbConnectionPool and harden WaitHandleDbConnectionPool shutdown.
Relevant discussions:
Is your feature request related to a problem? Please describe.
The pool shutdown work in #4302 deferred a follow-up to simplify internal connection pool state tracking. The discussion concluded that the pools need to distinguish running from not running, rather than introduce additional lifecycle states.
The current enum-based representation also encourages checks and log messages that assume "not running" specifically means "shutting down."
Describe the solution you'd like
Replace the internal connection pool state enum with a boolean running flag, consistently across
ChannelDbConnectionPoolandWaitHandleDbConnectionPool.This is an internal implementation change; it must not change the public
SqlConnection.StateAPI or theSystem.Data.ConnectionStateenum.Describe alternatives you've considered
Retain an enum and introduce explicit lifecycle states such as Created, Starting, Started, Stopping, and Stopped. This was discussed in #4302, but the follow-up direction was to use a boolean without introducing new states.
Additional context
Source: User Story 45932: Changing ConnectionState from enum to bool.
Related PR: #4302 — Implement pool shutdown for ChannelDbConnectionPool and harden WaitHandleDbConnectionPool shutdown.
Relevant discussions: