Skip to content

Commit bd45740

Browse files
committed
don't select closed conn in pool
1 parent 7563713 commit bd45740

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/pool/pool_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class PoolImplementation<L> implements Pool<L> {
177177
Future<_PoolConnection> _selectOrCreate(
178178
Endpoint endpoint, ResolvedConnectionSettings settings) async {
179179
final oldc =
180-
_connections.firstWhereOrNull((c) => c._mayReuse(endpoint, settings));
180+
_connections.firstWhereOrNull((c) => c._mayReuse(endpoint, settings) && c.isOpen);
181181
if (oldc != null) {
182182
// NOTE: It is important to update the _isInUse flag here, otherwise
183183
// race conditions may create conflicts.

0 commit comments

Comments
 (0)