diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-16 18:41:36 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-16 18:41:36 +0100 |
commit | 0c88df7c5fc60084f8fb86431e5123032fc4385f (patch) | |
tree | f4ccb887f16aad0a2f4c95ce3fe6d984846401e4 /src | |
parent | 5e9346b12853b027b1ae007b1a86d52d617f45a0 (diff) | |
download | rabbitmq-server-0c88df7c5fc60084f8fb86431e5123032fc4385f.tar.gz |
Fixed cycle detection, resources and names were messed up.
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index e4dd3206..20aa38a3 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -739,10 +739,10 @@ dead_letter_publish(Msg, Reason, false, false, make_dead_letter_msg(DLX, Reason, Msg, State), MsgSeqNo), {ok, X} = rabbit_exchange:lookup(XName), - QueueNames = rabbit_exchange:route(X, Delivery), - {QueueNames1, Cycles} = detect_dead_letter_cycles(Delivery, QueueNames), + Queues = rabbit_exchange:route(X, Delivery), + {Queues1, Cycles} = detect_dead_letter_cycles(Delivery, Queues), lists:foreach(fun log_cycle_once/1, Cycles), - QPids = rabbit_amqqueue:lookup(QueueNames1), + QPids = rabbit_amqqueue:lookup(Queues1), {_, DeliveredQPids} = rabbit_amqqueue:deliver(QPids, Delivery), DeliveredQPids. @@ -808,10 +808,10 @@ cleanup_after_confirm(AckTags, State = #q{delayed_stop = DS, end. detect_dead_letter_cycles(#delivery{message = #basic_message{content = Content}}, - QueueNames) -> + Queues) -> #content{properties = #'P_basic'{headers = Headers}} = rabbit_binary_parser:ensure_content_decoded(Content), - NoCycles = {QueueNames, []}, + NoCycles = {Queues, []}, case Headers of undefined -> NoCycles; @@ -824,13 +824,15 @@ detect_dead_letter_cycles(#delivery{message = #basic_message{content = Content}} OldQueuesSet = ordsets:from_list(OldQueues1), {Cycling, NotCycling} = lists:partition( - fun(QueueName) -> - ordsets:is_element(QueueName, OldQueuesSet) - end, QueueNames), + fun(Queue) -> + ordsets:is_element(Queue#resource.name, + OldQueuesSet) + end, Queues), {NotCycling, - lists:map(fun (Q) -> [Q | OldQueues1] end, Cycling)}; + lists:map( + fun (Q) -> [Q#resource.name | OldQueues1] end, Cycling)}; _ -> - QueueNames + NoCycles end end. |