File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -253,25 +253,6 @@ impl Pool {
253
253
fn return_conn ( & mut self , conn : Conn ) {
254
254
// NOTE: we're not in async context here, so we can't block or return NotReady
255
255
// any and all cleanup work _has_ to be done in the spawned recycler
256
-
257
- // fast-path for when the connection is immediately ready to be reused
258
- if conn. inner . stream . is_some ( )
259
- && !conn. inner . disconnected
260
- && !conn. expired ( )
261
- && conn. inner . tx_status == TxStatus :: None
262
- && !conn. has_pending_result ( )
263
- && !self . inner . close . load ( atomic:: Ordering :: Acquire )
264
- {
265
- let mut exchange = self . inner . exchange . lock ( ) . unwrap ( ) ;
266
- if exchange. available . len ( ) < self . opts . pool_opts ( ) . active_bound ( ) {
267
- exchange. available . push_back ( conn. into ( ) ) ;
268
- if let Some ( w) = exchange. waiting . pop ( ) {
269
- w. wake ( ) ;
270
- }
271
- return ;
272
- }
273
- }
274
-
275
256
self . send_to_recycler ( conn) ;
276
257
}
277
258
@@ -492,6 +473,9 @@ mod test {
492
473
. map ( |conn| conn. id ( ) )
493
474
. collect :: < Vec < _ > > ( ) ;
494
475
476
+ // give some time to reset connections
477
+ sleep ( Duration :: from_millis ( 500 ) ) . await ;
478
+
495
479
// get_conn should work if connection is available and alive
496
480
pool. get_conn ( ) . await ?;
497
481
You can’t perform that action at this time.
0 commit comments