From ab0548d8e2f00ecebb3b893d6ae37ed154bb8188 Mon Sep 17 00:00:00 2001 From: Joseph Shearer Date: Fri, 4 Oct 2024 15:45:51 -0400 Subject: [PATCH] dekaf: Remove connection healthcheck as `FindCoordinator` takes ~3-5 seconds to respond --- crates/dekaf/src/api_client.rs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/crates/dekaf/src/api_client.rs b/crates/dekaf/src/api_client.rs index 9adda13c8a..29ee73a43c 100644 --- a/crates/dekaf/src/api_client.rs +++ b/crates/dekaf/src/api_client.rs @@ -297,29 +297,10 @@ impl deadpool::managed::Manager for KafkaConnectionParams { async fn recycle( &self, - conn: &mut BoxedKafkaConnection, + _conn: &mut BoxedKafkaConnection, _: &deadpool::managed::Metrics, ) -> deadpool::managed::RecycleResult { - // Other than auth (and `ApiVersions` apparently) Kafka connections themselves are stateless - // so the only thing we need to do when recycling a connection - // is to confirm that it's still connected. - send_request( - conn, - messages::FindCoordinatorRequest::default() - .with_key(protocol::StrBytes::from_string("test".to_string())) - .with_key_type(0), - Some( - messages::RequestHeader::default() - .with_request_api_key(messages::FindCoordinatorRequest::KEY) - .with_request_api_version(3), - ), - ) - .await - .map(|_| ()) - .map_err(|e| { - tracing::warn!(err=?e, broker=self.broker_url, "Connection failed healthcheck"); - deadpool::managed::RecycleError::Backend(e) - }) + Ok(()) } }