Skip to content

Commit 004d72e

Browse files
Merge pull request #388 from rabbitmq/md-handle-shutdown-genstatem-call
Handle shutdown exits in gen_statem:call/3
2 parents c1d2036 + 3e7e199 commit 004d72e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ra.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
-type consistent_query_ref() :: {From :: term(), Query :: ra:query_fun(), ConmmitIndex :: ra_index()}.
6767

68-
-type safe_call_ret(T) :: timeout | {error, noproc | nodedown} | T.
68+
-type safe_call_ret(T) :: timeout | {error, noproc | nodedown | shutdown} | T.
6969

7070
-type states() :: leader | follower | candidate | await_condition.
7171

src/ra_server_proc.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,9 @@ gen_statem_safe_call(ServerId, Msg, Timeout) ->
14991499
exit:{noproc, _} ->
15001500
{error, noproc};
15011501
exit:{{nodedown, _}, _} ->
1502-
{error, nodedown}
1502+
{error, nodedown};
1503+
exit:{shutdown, _} ->
1504+
{error, shutdown}
15031505
end.
15041506

15051507
do_state_query(all, State) -> State;

0 commit comments

Comments
 (0)