From 9bd108060c7bf2a59d5fea8d115845db32883f63 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 23 Jul 2024 10:30:39 -0600 Subject: [PATCH] Minor cleanup --- edb/server/conn_pool/README.md | 6 ------ edb/server/conn_pool/src/conn.rs | 9 ++------- edb/server/conn_pool/src/waitqueue.rs | 13 ------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/edb/server/conn_pool/README.md b/edb/server/conn_pool/README.md index 7a4d095a69d6..941f478bed4b 100644 --- a/edb/server/conn_pool/README.md +++ b/edb/server/conn_pool/README.md @@ -120,11 +120,5 @@ potential sources for a connection for the acquire. Sources for a connection may be a currently-connecting connection, a reconnecting connection, a connection that is actively held by someone else or a connection that is sitting idle. -If an acquire operation is queued for a connection, and a block's last -connection becomes invalid due to an error, and the operation is next in line, -that operation will fail, returning the error as the failure reason. The -remainder of the connections that are queued will continue to await a connection -and, if the error is persistent, will eventually return errors as well. - The pool does not currently retry, and retry logic should be included in the connect operation. diff --git a/edb/server/conn_pool/src/conn.rs b/edb/server/conn_pool/src/conn.rs index 020297e96312..5a08e5d77825 100644 --- a/edb/server/conn_pool/src/conn.rs +++ b/edb/server/conn_pool/src/conn.rs @@ -397,11 +397,6 @@ impl Conns { self.conns.borrow().len() } - #[inline] - pub fn is_empty(&self) -> bool { - self.conns.borrow().is_empty() - } - #[inline] pub fn youngest(&self) -> Duration { self.youngest.get().elapsed() @@ -479,7 +474,7 @@ impl Conns { let range: &mut dyn Iterator = if mru { &mut (0..lock.len()).rev() } else { - &mut (0..lock.len()).into_iter() + &mut (0..lock.len()) }; for pos in range { return match lock[pos].variant() { @@ -492,7 +487,7 @@ impl Conns { MetricVariant::Failed => { trace!("Got an error"); let conn = lock.swap_remove(pos); - conn.untrack(&metrics); + conn.untrack(metrics); // We know that a removed connection cannot have a handle active, so the // `Rc` unwrap will always succeed. diff --git a/edb/server/conn_pool/src/waitqueue.rs b/edb/server/conn_pool/src/waitqueue.rs index 321426e541a0..ef8510de3dee 100644 --- a/edb/server/conn_pool/src/waitqueue.rs +++ b/edb/server/conn_pool/src/waitqueue.rs @@ -55,19 +55,6 @@ impl WaitQueue { } } - pub fn trigger_all(&self) { - trace!("Trigginging all waiters"); - while let Some(front) = self.waiters.borrow_mut().pop_front() { - if front.gc.get() { - trace!("Tossing away a GC'd entry"); - continue; - } - trace!("Triggered a waiter"); - front.woke.set(true); - front.waker.wake_by_ref(); - } - } - pub async fn queue(&self) { trace!("Queueing"); let waker = poll_fn(|cx| Poll::Ready(cx.waker().clone())).await;