From 0aa3606c4f895dcdc139065080fa8c004e681887 Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Fri, 5 Aug 2022 17:36:52 +0200 Subject: [PATCH] k/connection_context: use warn severity for unsupported api versions 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 --- src/v/kafka/server/connection_context.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/v/kafka/server/connection_context.cc b/src/v/kafka/server/connection_context.cc index 9eb64ef35c46a..2ec16a839cad5 100644 --- a/src/v/kafka/server/connection_context.cc +++ b/src/v/kafka/server/connection_context.cc @@ -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, + "Error while processing 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