You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Open | bool | open session | session_pool.Open(false) |
46
46
| Close | null | close session | session_pool.Close() |
47
-
| IsOpen | null | check if session is open| session_pool.IsOpen() |
47
+
| IsOpen | null | check if the pool was opened and not yet closed by the caller. It is a lifecycle flag, **not** a connectivity probe: it stays `true` after the server goes down, because the client keeps no heartbeat and reconnects on demand instead.| session_pool.IsOpen() |
| Available Clients |`AvailableClients`| Number of idle clients ready for use | Alert if < 25% of pool size |
83
130
| Total Pool Size |`TotalPoolSize`| Configured maximum pool size | N/A (constant) |
131
+
| Unrealized Capacity |`UnrealizedCapacity`| Configured capacity currently holding no connection, refilled on demand | Not an alert signal on its own - see below |
84
132
| Failed Reconnections |`FailedReconnections`| Cumulative count of failed reconnection attempts | Alert if > 0 and increasing |
85
133
134
+
### Capacity is demand-driven
135
+
136
+
When an operation fails and reconnection also fails, the dead connection is discarded but its **capacity is
137
+
retained** rather than lost. `UnrealizedCapacity` counts the capacity left without a connection, and an
138
+
acquisition that finds no idle client materializes one connection before falling back to waiting.
139
+
Consequences:
140
+
141
+
- The pool no longer shrinks by one on every failure, so it cannot reach the state where every caller blocks
142
+
on a queue nobody will feed.
143
+
- Once the server is reachable again, the pool repopulates itself as load demands it - no `Close()` +
144
+
`Open()` cycle is required.
145
+
-**Capacity is refilled on demand, not eagerly.** A connection is only created when an acquisition finds the
146
+
idle queue empty. Under sequential or light workloads one connection is enough to serve every request, so
147
+
`UnrealizedCapacity` legitimately stays above zero long after the server has fully recovered. It measures
148
+
how much of the configured pool has not been materialized, not server availability.
149
+
- Therefore **do not alert on `UnrealizedCapacity` alone.** Use `FailedReconnections` to reason about server
150
+
reachability: it only increases when a reconnection actually fails.
0 commit comments