Skip to content

Commit 9f3df94

Browse files
committed
debug: log more
1 parent 456bd8f commit 9f3df94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

store/postgres/src/connection_pool.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,18 @@ impl PoolState {
380380

381381
use PoolStateInner::*;
382382
match &*guard {
383-
Created(pool, coord) => (pool.cheap_clone(), coord.cheap_clone()),
383+
Created(pool, coord) => {
384+
warn!(self.logger, "pool_state: pool not ready; creating");
385+
(pool.cheap_clone(), coord.cheap_clone())
386+
}
384387
Ready(pool) => return Ok(pool.clone()),
385388
}
386389
};
387390

388391
// self is `Created` and needs to have setup run
392+
warn!(self.logger, "pool_state: setting up pool");
389393
let migrated = coord.setup_bg(self.cheap_clone())?;
394+
warn!(self.logger, "pool_state: pool is ready");
390395
if migrated {
391396
Ok(pool)
392397
} else {
@@ -1547,6 +1552,7 @@ impl PoolCoordinator {
15471552
/// the setup was actually run, i.e. if `pool` was available
15481553
fn setup_bg(self: Arc<Self>, pool: PoolState) -> Result<bool, StoreError> {
15491554
let migrated = graph::spawn_thread("database-setup", move || {
1555+
std::thread::sleep(Duration::from_secs(1));
15501556
graph::block_on(self.setup(vec![pool.clone()]))
15511557
})
15521558
.join()

0 commit comments

Comments
 (0)