diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-09 16:05:35 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-09 16:05:35 +0100 |
commit | 28062ca1238cd9b32a105494b457741c704fbf86 (patch) | |
tree | d7c46447b53fd5e340027258d5b1ddde61ae57f0 | |
parent | 265b0c1db5715b79f39864f58892f496b827833f (diff) | |
download | rabbitmq-server-28062ca1238cd9b32a105494b457741c704fbf86.tar.gz |
Ignore process_death, explain why.
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 307f2b4f..36f9766d 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -257,8 +257,8 @@ handle_info(timeout, State) -> noreply(backing_queue_timeout(State)); handle_info({'DOWN', _MonitorRef, process, MPid, _Reason}, - State = #state { gm = GM, master_pid = MPid }) -> - ok = gm:broadcast(GM, {process_death, MPid}), + State = #state { gm = GM, master_pid = MPid }) -> + ok = gm:broadcast(GM, process_death), noreply(State); handle_info({'DOWN', _MonitorRef, process, ChPid, _Reason}, State) -> @@ -353,8 +353,15 @@ handle_msg([_SPid], _From, request_depth) -> handle_msg([_SPid], _From, {ensure_monitoring, _Pid}) -> %% This is only of value to the master ok; -handle_msg([SPid], _From, {process_death, Pid}) -> - inform_deaths(SPid, [Pid]); +handle_msg([_SPid], _From, process_death) -> + %% Since GM is by nature lazy we need to make sure there is some + %% traffic when a master dies, to make sure we get informed of the + %% death. That's all process_death does, create some traffic. We + %% must not take any notice of the master death here since it + %% comes without ordering guarantees - there could still be + %% messages from the master we have yet to receive. When we get + %% members_changed, then there will be no more messages. + ok; handle_msg([CPid], _From, {delete_and_terminate, _Reason} = Msg) -> ok = gen_server2:cast(CPid, {gm, Msg}), {stop, {shutdown, ring_shutdown}}; |