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 | b48e9c20a654ca202fb1e86e50711cffb0cb9d37 (patch) | |
tree | 52dc00e44db273f0128652a09ee8b09d6464e600 | |
parent | c60c999c2086d1f2d843cde36bc1a91fa7b698d3 (diff) | |
download | rabbitmq-server-b48e9c20a654ca202fb1e86e50711cffb0cb9d37.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 94943677..f2a48ae2 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), |