Skip to content

Commit 1d17d73

Browse files
committed
WIP: Increase connection pool size for integration tests
1 parent 4d9967e commit 1d17d73

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

store/postgres/src/pool/mod.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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

tests/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)