diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2013-06-11 13:56:54 +0100 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2013-06-11 13:56:54 +0100 |
| commit | a5997d74847ad79fadcb393e392b3c343aaec0e4 (patch) | |
| tree | 0ed4ea6a21ebe551f1fb7e8f2dab5ad057206074 | |
| parent | b9b0d99c9a49e756a223c3deaf7aaf9216397801 (diff) | |
| download | rabbitmq-server-git-a5997d74847ad79fadcb393e392b3c343aaec0e4.tar.gz | |
Omit emitting stats for non-existent queues on termination
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index a7a227e16b..45a45dba29 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -153,6 +153,8 @@ init_state(Q) -> terminate(shutdown = R, State = #q{backing_queue = BQ}) -> terminate_shutdown(fun (BQS) -> BQ:terminate(R, BQS) end, State); +terminate({shutdown, missing_owner}, State) -> + terminate(missing_owner, State); terminate({shutdown, _} = R, State = #q{backing_queue = BQ}) -> terminate_shutdown(fun (BQS) -> BQ:terminate(R, BQS) end, State); terminate(Reason, State = #q{q = #amqqueue{name = QName}, @@ -161,8 +163,11 @@ terminate(Reason, State = #q{q = #amqqueue{name = QName}, fun (BQS) -> BQS1 = BQ:delete_and_terminate(Reason, BQS), %% don't care if the internal delete doesn't return 'ok'. - rabbit_event:if_enabled(State, #q.stats_timer, - fun() -> emit_stats(State) end), + if Reason =/= missing_owner -> + rabbit_event:if_enabled(State, #q.stats_timer, + fun() -> emit_stats(State) end); + true -> ok + end, rabbit_amqqueue:internal_delete(QName), BQS1 end, State). @@ -1059,8 +1064,8 @@ handle_call({init, Recover}, From, BQ = backing_queue_module(Q), BQS = bq_init(BQ, Q, Recover), %% Rely on terminate to delete the queue. - {stop, normal, State#q{backing_queue = BQ, - backing_queue_state = BQS}} + {stop, {shutdown, missing_owner}, + State#q{backing_queue = BQ, backing_queue_state = BQS}} end; handle_call(info, _From, State) -> |
