summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-06-11 18:01:33 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-06-11 18:01:33 +0100
commit20370276a5dd52b3fba2d397420a5e716a86859f (patch)
tree8bd307ff177aa62e9a515f24e76d01056d316d5c /src
parent8903e78550e21577492b43afb9ccecdf592f3d70 (diff)
downloadrabbitmq-server-git-20370276a5dd52b3fba2d397420a5e716a86859f.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.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 1de14b5ce4..22692dcbfe 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,