Skip to content

Commit ef58180

Browse files
committed
Drop a lock earlier
Once we have the connection, we can unlock the exchange.
1 parent 01efa4c commit ef58180

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/conn/pool/recycler.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,12 @@ impl Future for Recycler {
165165

166166
// if we've been asked to close, reclaim any idle connections
167167
if close || self.eof {
168-
while let Some(IdlingConn { conn, .. }) =
169-
self.inner.exchange.lock().unwrap().available.pop_front()
170-
{
168+
loop {
169+
let Some(IdlingConn { conn, .. }) =
170+
self.inner.exchange.lock().unwrap().available.pop_front()
171+
else {
172+
break;
173+
};
171174
assert!(conn.inner.pool.is_none());
172175
conn_decision!(self, conn);
173176
}

0 commit comments

Comments
 (0)