diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-07-01 16:38:07 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-07-01 16:38:07 +0100 |
| commit | c40fe2d2e8e391430c9f3dae400afe8fe2ebad77 (patch) | |
| tree | a5ad9452d3e5f652d9b1c13bf268510b9c1a23e9 /src | |
| parent | f7d1e25c659c7a9e13b81ac113a2e8dce0be4908 (diff) | |
| download | rabbitmq-server-git-c40fe2d2e8e391430c9f3dae400afe8fe2ebad77.tar.gz | |
Be less chatty.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mirrored_supervisor.erl | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl index 4b7f63d700..5506ea22ea 100644 --- a/src/mirrored_supervisor.erl +++ b/src/mirrored_supervisor.erl @@ -96,7 +96,6 @@ start_internal(Sup, Group, Args) -> init({Sup, Group, _Args}) -> pg2_fixed:create(Group), [begin - io:format("Announce to ~p~n", [Pid]), gen_server2:call(Pid, {hello, self()}, infinity), erlang:monitor(process, Pid) end @@ -106,10 +105,8 @@ init({Sup, Group, _Args}) -> handle_call({start_child, ChildSpec}, _From, State = #state{sup = Sup}) -> {reply, case mnesia:transaction(fun() -> check_start(ChildSpec) end) of - {atomic, start} -> io:format("Start ~p~n", [id(ChildSpec)]), - start(Sup, ChildSpec); - {atomic, Pid} -> io:format("Already ~p~n", [id(ChildSpec)]), - {ok, Pid} + {atomic, start} -> start(Sup, ChildSpec); + {atomic, Pid} -> {ok, Pid} end, State}; handle_call({delete_child, Id}, _From, State = #state{sup = Sup}) -> @@ -120,7 +117,6 @@ handle_call({msg, F, A}, _From, State) -> {reply, apply(?SUPERVISOR, F, A), State}; handle_call({hello, Pid}, _From, State) -> - io:format("Hello from ~p~n", [Pid]), erlang:monitor(process, Pid), {reply, ok, State}; @@ -135,16 +131,12 @@ handle_cast(Msg, State) -> handle_info({'DOWN', _Ref, process, Pid, _Reason}, State = #state{sup = Sup, group = Group}) -> - io:format("Pid ~p down!~n", [Pid]), %% TODO load balance this Self = self(), case lists:sort(pg2_fixed:get_members(Group)) of [Self | _] -> {atomic, ChildSpecs} = mnesia:transaction(fun() -> update_all(Pid) end), - [begin - start(Sup, ChildSpec), - io:format("Restarted ~p~n", [id(ChildSpec)]) - end || ChildSpec <- ChildSpecs]; + [start(Sup, ChildSpec) || ChildSpec <- ChildSpecs]; _ -> ok end, {noreply, State}; |
