From e800be0e9a07193d977f84f124934f6ccd62739d 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/v/kafka/server/connection_context.cc b/src/v/kafka/server/connection_context.cc index 9eb64ef35c46..e3afdc2550af 100644 --- a/src/v/kafka/server/connection_context.cc +++ b/src/v/kafka/server/connection_context.cc @@ -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