From e2a6c895573cec90692b82a901d2134d6ff3dac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Fri, 26 Apr 2024 12:51:34 +0000 Subject: [PATCH] admin: fixed mapping of service unavailable error code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the service_unavailable error code was mapped to generic unexpected server error. This lead to a situation in which a lot of errors were logged when broker was restarted as it has an RPC server running but without the services registered. Changed the mapping of `rpc::errc::service_unavailable` to HTTP service unavailable error. Fixes: #17739 Signed-off-by: Michał Maślanka (cherry picked from commit 1a9f248cd979ec235bbacb8b6017e077ca073fc9) --- src/v/redpanda/admin/server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v/redpanda/admin/server.cc b/src/v/redpanda/admin/server.cc index 60aca75c3dd3..322607298286 100644 --- a/src/v/redpanda/admin/server.cc +++ b/src/v/redpanda/admin/server.cc @@ -1148,6 +1148,7 @@ ss::future<> admin_server::throw_on_error( case rpc::errc::disconnected_endpoint: case rpc::errc::exponential_backoff: case rpc::errc::shutting_down: + case rpc::errc::service_unavailable: case rpc::errc::missing_node_rpc_client: throw ss::httpd::base_exception( fmt::format("Not ready: {}", ec.message()), @@ -1160,7 +1161,6 @@ ss::future<> admin_server::throw_on_error( case rpc::errc::service_error: case rpc::errc::method_not_found: case rpc::errc::version_not_supported: - case rpc::errc::service_unavailable: case rpc::errc::unknown: throw ss::httpd::server_error_exception( fmt::format("Unexpected error: {}", ec.message()));