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: redpanda-data#5868

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Aug 5, 2022
1 parent 9a200ce commit 74a2aff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,14 @@ 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,
"Unsupported API version in request from {} - {}",
_rs.conn->addr,
e.what());
})
.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 74a2aff

Please sign in to comment.