Skip to content

Commit

Permalink
dekaf: Remove connection healthcheck as FindCoordinator takes ~3-5 …
Browse files Browse the repository at this point in the history
…seconds to respond
  • Loading branch information
jshearer committed Oct 4, 2024
1 parent 39ba17e commit ab0548d
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions crates/dekaf/src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<anyhow::Error> {
// 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(())
}
}

Expand Down

0 comments on commit ab0548d

Please sign in to comment.