File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ impl PoolState {
180180 // We just tried to set up the pool; if it is still not set up and
181181 // we didn't have an error, it means the database is not available
182182 if self . needs_setup ( ) {
183+ error ! ( self . logger, "Database is not available, setup did not work" ) ;
183184 return Err ( StoreError :: DatabaseUnavailable ) ;
184185 } else {
185186 Ok ( pool)
@@ -511,10 +512,18 @@ impl PoolInner {
511512 }
512513
513514 async fn get ( & self ) -> Result < AsyncPgConnection , StoreError > {
514- self . pool
515- . get ( )
516- . await
517- . map_err ( |_| StoreError :: DatabaseUnavailable )
515+ match self . pool . get ( ) . await {
516+ Err ( e) => {
517+ let x = self . pool . state ( ) . await ;
518+ error ! (
519+ self . logger,
520+ "Error getting Postgres connection from pool: {e}, state: {x:?}" ;
521+ "timeout_set" => ENV_VARS . store. connection_timeout. as_millis( )
522+ ) ;
523+ Err ( StoreError :: DatabaseUnavailable )
524+ }
525+ Ok ( conn) => Ok ( conn) ,
526+ }
518527 }
519528
520529 /// Get the pool for fdw connections. It is an error if none is configured
Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ impl Config {
199199 & ports. admin . to_string ( ) ,
200200 "--metrics-port" ,
201201 & ports. metrics . to_string ( ) ,
202+ "--store-connection-pool-size" ,
203+ "40" ,
202204 ] ;
203205
204206 let args = args
You can’t perform that action at this time.
0 commit comments