diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-06-11 18:01:33 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-06-11 18:01:33 +0100 |
commit | 8cbcb07661c6bd83ec685977df85479bd2d24ee6 (patch) | |
tree | 8bd307ff177aa62e9a515f24e76d01056d316d5c | |
parent | 60775e2dc2eb6df4e686fdb167b91e50b71f3ca0 (diff) | |
download | rabbitmq-server-bug25600.tar.gz |
Emit consumer_deleted from the channel when we see a consumer go down, to cover the case where an HA queue master dies and is thus not able to emit the consumer_deleted itself. This means we can emit consumer_deleted twice in some circumstances I think, but that should be fine.bug25600
-rw-r--r-- | src/rabbit_channel.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 1de14b5c..22692dcb 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -1198,7 +1198,8 @@ handle_publishing_queue_down(QPid, Reason, State = #ch{unconfirmed = UC}) -> handle_consuming_queue_down(QPid, State = #ch{consumer_mapping = ConsumerMapping, - queue_consumers = QCons}) -> + queue_consumers = QCons, + queue_names = QNames}) -> ConsumerTags = case dict:find(QPid, QCons) of error -> gb_sets:new(); {ok, CTags} -> CTags @@ -1208,6 +1209,11 @@ handle_consuming_queue_down(QPid, ok = send(#'basic.cancel'{consumer_tag = CTag, nowait = true}, State), + rabbit_event:notify( + consumer_deleted, + [{consumer_tag, CTag}, + {channel, self()}, + {queue, dict:fetch(QPid, QNames)}]), dict:erase(CTag, CMap) end, ConsumerMapping, ConsumerTags), State#ch{consumer_mapping = ConsumerMapping1, |