Skip to content

Commit 67a9b82

Browse files
authored
fix(en): Fix statement timeout errors during cache recovery (#4248)
## What ❔ Disables statement timeouts for the connection pool used for state keeper cache recovery. ## Why ❔ Cache recovery logic incorporates potentially long-running queries, so having the default timeout for it is bogus. ## Is this a breaking change? - [ ] Yes - [x] No ## Operational changes No operational changes. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.
1 parent f29cba8 commit 67a9b82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/node/state_keeper/src/node/state_keeper.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ impl WiringLayer for StateKeeperLayer {
8787
self.rocksdb_options,
8888
);
8989
// The number of connections in the recovery DB pool (~recovery concurrency) is based on the Era mainnet recovery runs.
90-
let recovery_pool = input.replica_pool.get_custom(10).await?;
90+
let recovery_pool = input
91+
.replica_pool
92+
.build(|builder| {
93+
// Disable the statement timeout since there are potential long-living queries inside recovery logic.
94+
builder.set_statement_timeout(None).set_max_size(10);
95+
})
96+
.await?;
9197
rocksdb_catchup = rocksdb_catchup.with_recovery_pool(recovery_pool);
9298

9399
let state_keeper_builder = StateKeeperBuilder::new(

0 commit comments

Comments
 (0)