@@ -438,15 +438,6 @@ impl PoolInner {
438438 const_labels. clone ( ) ,
439439 ) ;
440440
441- // Note: deadpool does not support min_idle configuration
442- if let Some ( min_idle) = ENV_VARS . store . connection_min_idle {
443- warn ! (
444- logger_pool,
445- "min_idle configuration ({}) is not supported by deadpool and will be ignored" ,
446- min_idle
447- ) ;
448- }
449-
450441 let timeouts = Timeouts {
451442 wait : Some ( ENV_VARS . store . connection_timeout ) ,
452443 create : Some ( ENV_VARS . store . connection_timeout ) ,
@@ -467,6 +458,8 @@ impl PoolInner {
467458
468459 manager:: spawn_size_stat_collector ( pool. clone ( ) , & registry, const_labels. clone ( ) ) ;
469460
461+ manager:: spawn_connection_reaper ( pool. clone ( ) , ENV_VARS . store . connection_idle_timeout ) ;
462+
470463 let wait_meter = WaitMeter :: new ( & registry, const_labels. clone ( ) ) ;
471464
472465 let fdw_pool = fdw_pool_size. map ( |pool_size| {
@@ -476,14 +469,17 @@ impl PoolInner {
476469 recycle : Some ( FDW_IDLE_TIMEOUT ) ,
477470 } ;
478471
479- AsyncPool :: builder ( conn_manager)
472+ let fdw_pool = AsyncPool :: builder ( conn_manager)
480473 . max_size ( pool_size as usize )
481474 . timeouts ( fdw_timeouts)
482475 . runtime ( Runtime :: Tokio1 )
483476 . post_create ( state_tracker. mark_available_hook ( ) )
484477 . post_recycle ( state_tracker. mark_available_hook ( ) )
485478 . build ( )
486- . expect ( "failed to create fdw connection pool" )
479+ . expect ( "failed to create fdw connection pool" ) ;
480+
481+ manager:: spawn_connection_reaper ( fdw_pool. clone ( ) , FDW_IDLE_TIMEOUT ) ;
482+ fdw_pool
487483 } ) ;
488484
489485 info ! ( logger_store, "Pool successfully connected to Postgres" ) ;
0 commit comments