Skip to content

Commit

Permalink
rpc/simple_protocol: disambiguate condition variable timeout exception
Browse files Browse the repository at this point in the history
When `ss::condition_variable_timeout_exception` is thrown from service
handler it should not be treated as generic error but result in timeout
being returned to the client.

Fixes: #6201

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Aug 25, 2022
1 parent 5fe1999 commit 382f98d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/v/rpc/simple_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "rpc/types.h"
#include "ssx/semaphore.h"

#include <seastar/core/condition-variable.hh>
#include <seastar/core/future-util.hh>

#include <exception>
Expand Down Expand Up @@ -183,6 +184,10 @@ simple_protocol::dispatch_method_once(header h, net::server::resources rs) {
rpclog.debug("Timing out request on timed_out_error "
"(shutting down)");
reply_buf.set_status(rpc::status::request_timeout);
} catch (const ss::condition_variable_timed_out& e) {
rpclog.debug(
"Timing out request on condition_variable_timed_out");
reply_buf.set_status(rpc::status::request_timeout);
} catch (const ss::gate_closed_exception& e) {
// gate_closed is typical during shutdown. Treat
// it like a timeout: request was not erroneous
Expand Down

0 comments on commit 382f98d

Please sign in to comment.