From e1fa844da438b66f597c0f9ada218357b18d9656 Mon Sep 17 00:00:00 2001 From: Elizabeth Murray Date: Fri, 20 Jun 2025 10:18:17 -0700 Subject: [PATCH] Clippy updates, add Cargo.lock. --- Cargo.lock | 4 ++++ .../communicator_pools/client_cache/Cargo.toml | 13 +++++++------ .../communicator_pools/client_cache/src/lib.rs | 5 ++++- .../communicator_pools/request_tracker/Cargo.toml | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a3c723c50..45071eb3ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1251,6 +1251,7 @@ dependencies = [ "tonic 0.13.1", "tower", "uuid", + "workspace_hack", ] [[package]] @@ -5682,6 +5683,9 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "request_tracker" version = "0.0.0" +dependencies = [ + "workspace_hack", +] [[package]] name = "reqwest" diff --git a/pageserver/communicator_pools/client_cache/Cargo.toml b/pageserver/communicator_pools/client_cache/Cargo.toml index 7d8a368a69..dc4d61f509 100644 --- a/pageserver/communicator_pools/client_cache/Cargo.toml +++ b/pageserver/communicator_pools/client_cache/Cargo.toml @@ -4,16 +4,17 @@ edition.workspace = true license.workspace = true [dependencies] +async-trait.workspace = true bytes.workspace = true -tonic.workspace = true -hyper-util = "0.1.9" +futures.workspace = true +hyper-util.workspace = true http.workspace = true +priority-queue = "2.3.1" +rand.workspace = true +tonic.workspace = true tokio.workspace = true tokio-util.workspace = true tower.workspace = true -futures.workspace = true uuid.workspace = true -priority-queue = "2.3.1" -rand.workspace = true -async-trait.workspace = true +workspace_hack.workspace = true diff --git a/pageserver/communicator_pools/client_cache/src/lib.rs b/pageserver/communicator_pools/client_cache/src/lib.rs index 7a72e37d4c..f1eefb16cb 100644 --- a/pageserver/communicator_pools/client_cache/src/lib.rs +++ b/pageserver/communicator_pools/client_cache/src/lib.rs @@ -6,7 +6,6 @@ use std::{ time::{Duration, Instant}, }; use tokio::sync::{Mutex, OwnedSemaphorePermit, Semaphore}; -use uuid; #[async_trait] pub trait PooledClientFactory: Send + Sync + 'static { @@ -18,6 +17,7 @@ pub trait PooledClientFactory: Send + Sync + 'static { } /// A pooled gRPC client with capacity tracking and error handling. +#[allow(dead_code)] pub struct ClientCache { inner: Mutex>, @@ -39,6 +39,7 @@ pub struct ClientCache { client_semaphore: Arc, } +#[allow(dead_code)] struct Inner { entries: HashMap>, pq: PriorityQueue, @@ -49,6 +50,7 @@ struct Inner { in_progress: usize, } +#[allow(dead_code)] struct CacheEntry { client: T, active_consumers: usize, @@ -57,6 +59,7 @@ struct CacheEntry { } /// A client borrowed from the pool. +#[allow(dead_code)] pub struct PooledClient { pub client: T, pool: Arc>, diff --git a/pageserver/communicator_pools/request_tracker/Cargo.toml b/pageserver/communicator_pools/request_tracker/Cargo.toml index 26cf758522..43c88d588e 100644 --- a/pageserver/communicator_pools/request_tracker/Cargo.toml +++ b/pageserver/communicator_pools/request_tracker/Cargo.toml @@ -4,3 +4,4 @@ edition.workspace = true license.workspace = true [dependencies] +workspace_hack.workspace = true