From efb9911e3ae8e6b09864cdbdd047dbe7bea7ea0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20M=C4=99drek?= Date: Thu, 12 Feb 2026 14:30:25 +0100 Subject: [PATCH] raft: Describe exception types for wait_for_state_change and wait_for_leader The methods of `raft::server` are abortable and if the passed `abort_source` is triggered, they throw `raft::request_aborted`. We document that. Although `raft::server` is an interface, this is consistent with the descriptions of its other methods. (cherry picked from commit e4f2b62019e84cd0b0595e154dd91aa0a961ffd7) --- raft/server.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/raft/server.hh b/raft/server.hh index 7be0e6154a..e956eb460a 100644 --- a/raft/server.hh +++ b/raft/server.hh @@ -252,6 +252,10 @@ public: // // The caller may pass a pointer to an abort_source to make the function abortable. // It it passes nullptr, the function is unabortable. + // + // Exceptions: + // raft::request_aborted + // Thrown if abort is requested before the operation finishes. virtual future<> wait_for_state_change(seastar::abort_source* as) = 0; // The returned future is resolved when a leader is elected for the current term. @@ -262,6 +266,10 @@ public: // // The caller may pass a pointer to an abort_source to make the function abortable. // It it passes nullptr, the function is unabortable. + // + // Exceptions: + // raft::request_aborted + // Thrown if abort is requested before the operation finishes. virtual future<> wait_for_leader(seastar::abort_source* as) = 0; // Manually trigger snapshot creation and log truncation.