diff --git a/proxy/src/serverless/http_conn_pool.rs b/proxy/src/serverless/http_conn_pool.rs index 7fc4cce91a..473aaa020b 100644 --- a/proxy/src/serverless/http_conn_pool.rs +++ b/proxy/src/serverless/http_conn_pool.rs @@ -4,11 +4,7 @@ use hyper_util::rt::{TokioExecutor, TokioIo}; use parking_lot::RwLock; use rand::Rng; use std::collections::VecDeque; -use std::ops::DerefMut; -use std::{ - ops::Deref, - sync::atomic::{self, AtomicUsize}, -}; +use std::sync::atomic::{self, AtomicUsize}; use std::{sync::Arc, sync::Weak}; use tokio::net::TcpStream; @@ -320,17 +316,8 @@ pub(crate) fn poll_http2_client( Client::new(client, aux) } -impl Client { - pub(crate) fn metrics(&self) -> Arc { - USAGE_METRICS.register(Ids { - endpoint_id: self.aux.endpoint_id, - branch_id: self.aux.branch_id, - }) - } -} - pub(crate) struct Client { - inner: Send, + pub(crate) inner: Send, aux: MetricsAuxInfo, } @@ -338,17 +325,11 @@ impl Client { pub(self) fn new(inner: Send, aux: MetricsAuxInfo) -> Self { Self { inner, aux } } -} -impl DerefMut for Client { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner - } -} -impl Deref for Client { - type Target = Send; - - fn deref(&self) -> &Self::Target { - &self.inner + pub(crate) fn metrics(&self) -> Arc { + USAGE_METRICS.register(Ids { + endpoint_id: self.aux.endpoint_id, + branch_id: self.aux.branch_id, + }) } } diff --git a/proxy/src/serverless/sql_over_http.rs b/proxy/src/serverless/sql_over_http.rs index 4db3a09e9a..f3a7ed9329 100644 --- a/proxy/src/serverless/sql_over_http.rs +++ b/proxy/src/serverless/sql_over_http.rs @@ -757,14 +757,6 @@ async fn handle_auth_broker_inner( let mut client = backend.connect_to_local_proxy(ctx, conn_info).await?; - // always completes instantly in http2 mode - // but good just in case - client - .ready() - .await - .map_err(LocalProxyConnError::from) - .map_err(HttpConnError::from)?; - let local_proxy_uri = ::http::Uri::from_static("http://proxy.local/sql"); let (mut parts, body) = request.into_parts(); @@ -786,6 +778,7 @@ async fn handle_auth_broker_inner( let _metrics = client.metrics(); Ok(client + .inner .send_request(req) .await .map_err(LocalProxyConnError::from)