diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-04-30 16:01:39 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-04-30 16:01:39 +0100 |
| commit | 95419546392fb9a2fc4d3269a8b35631c0fb7356 (patch) | |
| tree | 38f08090cb5d60858282a52703ebd839e236fa76 /src | |
| parent | 5f1fdd38d3463a48df1b7a7bab9e2634c1ea9c48 (diff) | |
| download | rabbitmq-server-git-95419546392fb9a2fc4d3269a8b35631c0fb7356.tar.gz | |
Log errors when children fail to start.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mirrored_supervisor.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl index 221f6a8727..c5f22c517b 100644 --- a/src/mirrored_supervisor.erl +++ b/src/mirrored_supervisor.erl @@ -306,9 +306,9 @@ handle_call({init, Overall}, _From, Delegate = child(Overall, delegate), erlang:monitor(process, Delegate), State1 = State#state{overall = Overall, delegate = Delegate}, - case all_started([maybe_start(Group, Delegate, S) || S <- ChildSpecs]) of - true -> {reply, ok, State1}; - false -> {stop, shutdown, State1} + case errors([maybe_start(Group, Delegate, S) || S <- ChildSpecs]) of + [] -> {reply, ok, State1}; + Errors -> {stop, {shutdown, Errors}, State1} end; handle_call({start_child, ChildSpec}, _From, @@ -372,9 +372,9 @@ handle_info({'DOWN', _Ref, process, Pid, _Reason}, [start(Delegate, ChildSpec) || ChildSpec <- ChildSpecs]; _ -> [] end, - case all_started(R) of - true -> {noreply, State}; - false -> {stop, shutdown, State} + case errors(R) of + [] -> {noreply, State}; + Errors -> {stop, {shutdown, Errors}, State} end; handle_info(Info, State) -> @@ -468,7 +468,7 @@ delete_all(Group) -> [delete(Group, id(C)) || C <- mnesia:select(?TABLE, [{MatchHead, [], ['$1']}])]. -all_started(Results) -> [] =:= [R || R = {error, _} <- Results]. +errors(Results) -> [E || {error, E} <- Results]. %%---------------------------------------------------------------------------- |
