Skip to content

Commit

Permalink
Revert "fix(vm-runner): Fix statement timeouts in VM playground (#2772)"
Browse files Browse the repository at this point in the history
This reverts commit d3cd553.
  • Loading branch information
slowli committed Sep 3, 2024
1 parent 5026e4a commit a8838eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ impl WiringLayer for VmPlaygroundLayer {
// to DB for querying last processed batch and last ready to be loaded batch.
// - `window_size` connections for running VM instances.
let connection_pool = replica_pool
.build(|builder| {
builder
.set_max_size(2 + self.config.window_size.get())
.set_statement_timeout(None);
// Unlike virtually all other replica pool uses, VM playground has some long-living operations,
// so the default statement timeout would only get in the way.
})
.get_custom(2 + self.config.window_size.get())
.await?;

let cursor = VmPlaygroundCursorOptions {
Expand Down
15 changes: 1 addition & 14 deletions core/node/node_framework/src/implementations/resources/pools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,7 @@ impl<P: PoolKind> PoolResource<P> {
}

pub async fn get_custom(&self, size: u32) -> anyhow::Result<ConnectionPool<P::DbMarker>> {
self.build(|builder| {
builder.set_max_size(size);
})
.await
}

pub async fn build<F>(&self, build_fn: F) -> anyhow::Result<ConnectionPool<P::DbMarker>>
where
F: FnOnce(&mut ConnectionPoolBuilder<P::DbMarker>),
{
let mut builder = self.builder();
build_fn(&mut builder);
let size = builder.max_size();
let result = builder.build().await;
let result = self.builder().set_max_size(size).build().await;

if result.is_ok() {
let old_count = self.connections_count.fetch_add(size, Ordering::Relaxed);
Expand Down

0 comments on commit a8838eb

Please sign in to comment.