summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-05-03 13:18:23 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-05-03 13:18:23 +0100
commit2d85d71d68bb1398a2538e14e7d43854996644e5 (patch)
tree47e1a6e05d4c07294970b68804e6a83bdc2ecbc9
parent164a4f7968f19357d13fac65d93d0c209899e770 (diff)
downloadrabbitmq-server-2d85d71d68bb1398a2538e14e7d43854996644e5.tar.gz
Revert aa8a9e4d1bb2 (extra debugging for mirrored_supervisor)
-rw-r--r--src/mirrored_supervisor.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl
index ff2b95a0..4fe93981 100644
--- a/src/mirrored_supervisor.erl
+++ b/src/mirrored_supervisor.erl
@@ -303,7 +303,7 @@ handle_call({init, Overall}, _From,
State1 = State#state{overall = Overall, delegate = Delegate},
case errors([maybe_start(Group, Delegate, S) || S <- ChildSpecs]) of
[] -> {reply, ok, State1};
- Errors -> {stop, {shutdown, {init, Errors, ChildSpecs}}, State1}
+ Errors -> {stop, {shutdown, Errors}, State1}
end;
handle_call({start_child, ChildSpec}, _From,
@@ -361,17 +361,15 @@ handle_info({'DOWN', _Ref, process, Pid, _Reason},
%% TODO load balance this
%% No guarantee pg2 will have received the DOWN before us.
Self = self(),
- {R, Cs, X} =
- case lists:sort(?PG2:get_members(Group)) -- [Pid] of
- [Self | _] -> {atomic, {ChildSpecs, Extra}} =
+ R = case lists:sort(?PG2:get_members(Group)) -- [Pid] of
+ [Self | _] -> {atomic, ChildSpecs} =
mnesia:transaction(fun() -> update_all(Pid) end),
- {[start(Delegate, ChildSpec) || ChildSpec <- ChildSpecs],
- ChildSpecs, Extra};
- _ -> {[], [], []}
+ [start(Delegate, ChildSpec) || ChildSpec <- ChildSpecs];
+ _ -> []
end,
case errors(R) of
[] -> {noreply, State};
- Errors -> {stop, {shutdown, {down, Errors, Cs, X}}, State}
+ Errors -> {stop, {shutdown, Errors}, State}
end;
handle_info(Info, State) ->
@@ -455,8 +453,8 @@ update_all(OldPid) ->
key = '$1',
childspec = '$2',
_ = '_'},
- Matches = mnesia:select(?TABLE, [{MatchHead, [], ['$$']}]),
- {[write(Group, C) || [{Group, _Id}, C] <- Matches], {OldPid, Matches}}.
+ [write(Group, C) ||
+ [{Group, _Id}, C] <- mnesia:select(?TABLE, [{MatchHead, [], ['$$']}])].
delete_all(Group) ->
MatchHead = #mirrored_sup_childspec{key = {Group, '_'},