Skip to content

Commit

Permalink
dekaf: Always decrement total_connections, even if error
Browse files Browse the repository at this point in the history
  • Loading branch information
jshearer committed Oct 3, 2024
1 parent 1ac9c90 commit fdd7c1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/dekaf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,21 @@ where

let mut out = bytes::BytesMut::new();
let mut raw_sasl_auth = false;
let mut res = Ok(());
while let Some(frame) = r.try_next().await? {
if let err @ Err(_) =
dekaf::dispatch_request_frame(&mut session, &mut raw_sasl_auth, frame, &mut out)
.await
{
// Close the connection on error
w.shutdown().await?;
return err;
res = err;
}
() = w.write_all(&mut out).await?;
out.clear();
}

Ok(())
res
}
.await;

Expand Down

0 comments on commit fdd7c1a

Please sign in to comment.