diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-09-11 12:05:04 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-09-11 12:05:04 +0100 |
| commit | 56f63e73b33fbec616e50c47ea8270d4dea5a656 (patch) | |
| tree | e5885b53378310cc1ec17fb2d9621aff7a54b1ef /src | |
| parent | 8b7dd7f2db2d64df15171c22c0384328a697f870 (diff) | |
| download | rabbitmq-server-git-56f63e73b33fbec616e50c47ea8270d4dea5a656.tar.gz | |
Emit a final event to say we crashed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 12a3c9f0a6..2f2a94f448 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -234,9 +234,19 @@ terminate({shutdown, _} = R, State = #q{backing_queue = BQ}) -> terminate_shutdown(fun (BQS) -> BQ:terminate(R, BQS) end, State); terminate(normal, State) -> %% delete case terminate_shutdown(terminate_delete(true, normal, State), State); -%% If we crashed don't try to clean up the BQS, probably best to leave it. -terminate(_Reason, State) -> - terminate_shutdown(fun (BQS) -> BQS end, State). +terminate(_Reason, State = #q{q = #amqqueue{name = Name}}) -> + terminate_shutdown( + fun (BQS) -> + rabbit_event:if_enabled( + State, #q.stats_timer, + fun () -> + rabbit_event:notify(queue_stats, [{name, Name}, + {state, crashed}]) + end), + %% If we crashed don't try to clean up the BQS, probably + %% best to leave it. + BQS + end, State). terminate_delete(EmitStats, Reason, State = #q{q = #amqqueue{name = QName}, |
