From ad5ba4c6434a91ae5f55754dd2479080b1d79e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20M=C4=99drek?= Date: Thu, 12 Feb 2026 12:47:03 +0100 Subject: [PATCH] raft: Await instead of returning future in wait_for_state_change The `try-catch` expression is pretty much useless in its current form. If we return the future, the awaiting will only be performed by the caller, completely circumventing the exception handling. As a result, instead of handling `raft::request_aborted` with a proper error message, the user will face `seastar::abort_requested_exception` whose message is cryptic at best. It doesn't even point to the root of the problem. Fixes SCYLLADB-665 (cherry picked from commit c36623baad607d5193e905455e72547337b1152f) --- raft/server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raft/server.cc b/raft/server.cc index 2beed13177..b90282ab23 100644 --- a/raft/server.cc +++ b/raft/server.cc @@ -459,7 +459,7 @@ future<> server_impl::wait_for_state_change(seastar::abort_source* as) { } try { - return as ? _state_change_promise->get_shared_future(*as) : _state_change_promise->get_shared_future(); + co_await (as ? _state_change_promise->get_shared_future(*as) : _state_change_promise->get_shared_future()); } catch (abort_requested_exception&) { throw request_aborted(fmt::format( "Aborted while waiting for state change on server: {}, latest applied entry: {}, current state: {}", _id, _applied_idx, _fsm->current_state()));