Skip to content

Commit

Permalink
k/connection_context: use warn severity for unsupported api versions
Browse files Browse the repository at this point in the history
When client requests an unsupported API version it is not an unexpected
situation and should not be logged with ERROR severity. Introduced
separate exception handler for unsupported API version exceptions.

Fixes: #5868

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Aug 8, 2022
1 parent 6ad2361 commit e800be0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/v/kafka/server/connection_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ ss::future<> connection_context::process_one_request() {
return ss::make_ready_future<>();
}
return dispatch_method_once(std::move(h.value()), s)
.handle_exception_type(
[this](const kafka_api_version_not_supported_exception& e) {
vlog(
klog.warn,
"Error while processing request from {} - {}",
_rs.conn->addr,
e.what());
_rs.conn->shutdown_input();
})
.handle_exception_type([this](const std::bad_alloc&) {
// In general, dispatch_method_once does not throw,
// but bad_allocs are an exception. Log it cleanly
Expand Down

0 comments on commit e800be0

Please sign in to comment.