Skip to content

Commit aace1b5

Browse files
committed
Introduce a rabbit_khepri:timeout_error() error type
1 parent bd2d6d9 commit aace1b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

deps/rabbit/src/rabbit_khepri.erl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@
180180
clear_forced_metadata_store/0]).
181181
-endif.
182182

183+
-type timeout_error() :: khepri:error(timeout).
184+
%% Commands like 'put'/'delete' etc. might time out in Khepri. It might take
185+
%% the leader longer to apply the command and reply to the caller than the
186+
%% configured timeout. This error is easy to reproduce - a cluster which is
187+
%% only running a minority of nodes will consistently return `{error, timeout}`
188+
%% for commands until the cluster majority can be re-established. Commands
189+
%% returning `{error, timeout}` are a likely (but not certain) indicator that
190+
%% the node which submitted the command is running in a minority.
191+
192+
-export_type([timeout_error/0]).
193+
183194
-compile({no_auto_import, [get/1, get/2, nodes/0]}).
184195

185196
-define(RA_SYSTEM, coordination).

0 commit comments

Comments
 (0)