Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure two connections for both executor and async catchup #1755

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions core/lib/zksync_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,11 @@ async fn add_state_keeper_to_task_futures(
batch_fee_input_provider: Arc<dyn BatchFeeModelInputProvider>,
stop_receiver: watch::Receiver<bool>,
) -> anyhow::Result<()> {
let pool_builder = ConnectionPool::<Core>::singleton(postgres_config.master_url()?);
let state_keeper_pool = pool_builder
// One (potentially held long-term) connection for async catch up task and another connection for
// batch executor.
slowli marked this conversation as resolved.
Show resolved Hide resolved
let state_keeper_pool_builder =
ConnectionPool::<Core>::builder(postgres_config.master_url()?, 2);
itegulov marked this conversation as resolved.
Show resolved Hide resolved
let state_keeper_pool = state_keeper_pool_builder
.build()
.await
.context("failed to build state_keeper_pool")?;
Expand All @@ -843,7 +846,7 @@ async fn add_state_keeper_to_task_futures(
mempool
};

let miniblock_sealer_pool = pool_builder
let miniblock_sealer_pool = ConnectionPool::<Core>::singleton(postgres_config.master_url()?)
.build()
.await
.context("failed to build miniblock_sealer_pool")?;
Expand Down Expand Up @@ -876,7 +879,7 @@ async fn add_state_keeper_to_task_futures(
}));
task_futures.push(tokio::spawn(state_keeper.run()));

let mempool_fetcher_pool = pool_builder
let mempool_fetcher_pool = ConnectionPool::<Core>::singleton(postgres_config.master_url()?)
.build()
.await
.context("failed to build mempool_fetcher_pool")?;
Expand Down
Loading