diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-03-01 14:59:17 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-03-01 14:59:17 +0000 |
| commit | e3865e504c09961d77e25e87e0944a4145a90bb4 (patch) | |
| tree | 52dc00e44db273f0128652a09ee8b09d6464e600 | |
| parent | 8b642dfe0c59265b9d78daf84ce20249dedb7594 (diff) | |
| download | rabbitmq-server-git-e3865e504c09961d77e25e87e0944a4145a90bb4.tar.gz | |
Don't throw away 'DOWN' in delayed_stop.
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 9494367764..f2a48ae27d 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -1341,6 +1341,22 @@ handle_cast(force_event_refresh, State = #q{exclusive_consumer = Exclusive}) -> handle_cast({dead_letter, {Msg, AckTag}, Reason}, State) -> dead_letter_msg(Msg, AckTag, Reason, State). +handle_info({'DOWN', _MonitorRef, process, DownPid, _Reason}, + State = #q{q = #amqqueue{exclusive_owner = DownPid}}) -> + %% Exclusively owned queues must disappear with their owner. In + %% the case of clean shutdown we delete the queue synchronously in + %% the reader - although not required by the spec this seems to + %% match what people expect (see bug 21824). However we need this + %% monitor-and-async- delete in case the connection goes away + %% unexpectedly. + stop_later(normal, State); + +handle_info({'DOWN', _MonitorRef, process, DownPid, Reason}, State) -> + case handle_ch_down(DownPid, State) of + {ok, State1} -> handle_queue_down(DownPid, Reason, State1); + {stop, State1} -> stop_later(normal, State1) + end; + handle_info(_, State = #q{delayed_stop = DS}) when DS =/= undefined -> noreply(State); @@ -1360,21 +1376,6 @@ handle_info(emit_stats, State) -> assert_invariant(State1), {noreply, State1, hibernate}; -handle_info({'DOWN', _MonitorRef, process, DownPid, _Reason}, - State = #q{q = #amqqueue{exclusive_owner = DownPid}}) -> - %% Exclusively owned queues must disappear with their owner. In - %% the case of clean shutdown we delete the queue synchronously in - %% the reader - although not required by the spec this seems to - %% match what people expect (see bug 21824). However we need this - %% monitor-and-async- delete in case the connection goes away - %% unexpectedly. - stop_later(normal, State); -handle_info({'DOWN', _MonitorRef, process, DownPid, Reason}, State) -> - case handle_ch_down(DownPid, State) of - {ok, State1} -> handle_queue_down(DownPid, Reason, State1); - {stop, State1} -> stop_later(normal, State1) - end; - handle_info(update_ram_duration, State = #q{backing_queue = BQ, backing_queue_state = BQS}) -> {RamDuration, BQS1} = BQ:ram_duration(BQS), |
