From ab61827fc125e7d7f60cd7e5ae42d8e065c36ec2 Mon Sep 17 00:00:00 2001 From: Zain Kabani Date: Fri, 26 May 2023 13:30:37 -0400 Subject: [PATCH 1/2] Use git bb8 --- Cargo.lock | 3 +-- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d26c4d52..64b8b87d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,8 +84,7 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bb8" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1627eccf3aa91405435ba240be23513eeca466b5dc33866422672264de061582" +source = "git+https://github.com/djc/bb8.git?rev=935b887#935b88781f3285040b20eb920f7dcfa3bd7533f0" dependencies = [ "async-trait", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index 17f7e0e7..915e291a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" tokio = { version = "1", features = ["full"] } bytes = "1" md-5 = "0.10" -bb8 = "0.8.0" +bb8 = { git = "https://github.com/djc/bb8.git", rev = "935b887" } async-trait = "0.1" rand = "0.8" chrono = "0.4" From 2ce63a3ea1c0fef766dd6e6767fe83d00b2c3a18 Mon Sep 17 00:00:00 2001 From: Zain Kabani Date: Sun, 28 May 2023 01:14:14 -0400 Subject: [PATCH 2/2] Use latest bb8 and change pool is use stack --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/pool.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64b8b87d..c99453a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,7 +84,7 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bb8" version = "0.8.0" -source = "git+https://github.com/djc/bb8.git?rev=935b887#935b88781f3285040b20eb920f7dcfa3bd7533f0" +source = "git+https://github.com/djc/bb8.git?rev=ad653e0#ad653e021607eb1f90ed6ce554d1766920308ffa" dependencies = [ "async-trait", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index 915e291a..cee5683a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" tokio = { version = "1", features = ["full"] } bytes = "1" md-5 = "0.10" -bb8 = { git = "https://github.com/djc/bb8.git", rev = "935b887" } +bb8 = { git = "https://github.com/djc/bb8.git", rev = "ad653e0" } # https://github.com/djc/bb8/commit/ad653e021607eb1f90ed6ce554d1766920308ffa async-trait = "0.1" rand = "0.8" chrono = "0.4" diff --git a/src/pool.rs b/src/pool.rs index 4fa27753..dff7b8e6 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -1,6 +1,6 @@ use arc_swap::ArcSwap; use async_trait::async_trait; -use bb8::{ManageConnection, Pool, PooledConnection}; +use bb8::{ManageConnection, Pool, PooledConnection, QueueStrategy}; use bytes::{BufMut, BytesMut}; use chrono::naive::NaiveDateTime; use log::{debug, error, info, warn}; @@ -401,6 +401,7 @@ impl ConnectionPool { .idle_timeout(Some(std::time::Duration::from_millis(idle_timeout))) .max_lifetime(Some(std::time::Duration::from_millis(server_lifetime))) .reaper_rate(std::time::Duration::from_millis(reaper_rate)) + .queue_strategy(QueueStrategy::Lifo) .test_on_check_out(false); let pool = if config.general.validate_config {