diff --git a/src/ra.hrl b/src/ra.hrl index 7d96f969..e706fc5a 100644 --- a/src/ra.hrl +++ b/src/ra.hrl @@ -65,7 +65,7 @@ -type consistent_query_ref() :: {From :: term(), Query :: ra:query_fun(), ConmmitIndex :: ra_index()}. --type safe_call_ret(T) :: timeout | {error, noproc | nodedown} | T. +-type safe_call_ret(T) :: timeout | {error, noproc | nodedown | shutdown} | T. -type states() :: leader | follower | candidate | await_condition. diff --git a/src/ra_server_proc.erl b/src/ra_server_proc.erl index 9b6eaa2b..e13ec1b8 100644 --- a/src/ra_server_proc.erl +++ b/src/ra_server_proc.erl @@ -1499,7 +1499,9 @@ gen_statem_safe_call(ServerId, Msg, Timeout) -> exit:{noproc, _} -> {error, noproc}; exit:{{nodedown, _}, _} -> - {error, nodedown} + {error, nodedown}; + exit:{shutdown, _} -> + {error, shutdown} end. do_state_query(all, State) -> State;