summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-02-11 14:07:56 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-02-11 14:07:56 +0000
commitd0ac7f6852722f7247238bf2c19abff653cbe9ad (patch)
tree5dc19b518388f3ffac52e88286492872305fcb6e
parent73eddad1a4751afe39477340fda6c6c7aa31fd0f (diff)
downloadrabbitmq-server-bug26005.tar.gz
Handle down messages from the delegate, since that's what we're monitoring locally. And make sure that cast/2 has cast-like semantics - don't blow up if the gen_server has stopped.bug26005
-rw-r--r--src/mirrored_supervisor.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl
index f44b1f1d..ae35526f 100644
--- a/src/mirrored_supervisor.erl
+++ b/src/mirrored_supervisor.erl
@@ -245,7 +245,9 @@ count_children(Sup) -> fold(count_children, Sup, fun add_proplists/2).
check_childspecs(Specs) -> ?SUPERVISOR:check_childspecs(Specs).
call(Sup, Msg) -> ?GEN_SERVER:call(mirroring(Sup), Msg, infinity).
-cast(Sup, Msg) -> ?GEN_SERVER:cast(mirroring(Sup), Msg).
+cast(Sup, Msg) -> with_exit_handler(
+ fun() -> ok end,
+ fun() -> ?GEN_SERVER:cast(mirroring(Sup), Msg) end).
find_call(Sup, Id, Msg) ->
Group = call(Sup, group),
@@ -369,7 +371,7 @@ handle_cast(Msg, State) ->
{stop, {unexpected_cast, Msg}, State}.
handle_info({'DOWN', _Ref, process, Pid, Reason},
- State = #state{overall = Pid, group = Group}) ->
+ State = #state{delegate = Pid, group = Group}) ->
%% Since the delegate is temporary, its death won't cause us to
%% die. Since the overall supervisor kills processes in reverse
%% order when shutting down "from above" and we started after the