From 62cb10b41e571ce6f7bf0abe4c10e43a4adc4683 Mon Sep 17 00:00:00 2001 From: Alexandru Scvortov Date: Wed, 26 Jan 2011 13:22:26 +0000 Subject: don't log stats for nacks (originating from queue deaths) --- src/rabbit_channel.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index ec4ca89e..a4c6e14d 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -508,6 +508,8 @@ confirm(MsgSeqNos, QPid, State = #ch{unconfirmed = UC}) -> remove_qmsg(MsgSeqNo, QPid, {XName, Qs}, {MXs, UC}, State) -> Qs1 = sets:del_element(QPid, Qs), + %% these confirms will be emitted even when a queue dies, but that + %% should be fine, since the queue stats get erased immediately maybe_incr_stats([{{QPid, XName}, 1}], confirm, State), case sets:size(Qs1) of 0 -> {[{MsgSeqNo, XName} | MXs], gb_trees:delete(MsgSeqNo, UC)}; @@ -1252,10 +1254,10 @@ lock_message(true, MsgStruct, State = #ch{unacked_message_q = UAMQ}) -> lock_message(false, _MsgStruct, State) -> State. +send_nacks([], State) -> + State; send_nacks(MXs, State) -> - MsgSeqNos = [ begin maybe_incr_stats([{ExchangeName, 1}], reject, State), - MsgSeqNo - end || {MsgSeqNo, ExchangeName} <- MXs ], + MsgSeqNos = [ MsgSeqNo || {MsgSeqNo, _} <- MXs ], coalesce_and_send(MsgSeqNos, fun(MsgSeqNo, Multiple) -> #'basic.nack'{delivery_tag = MsgSeqNo, -- cgit v1.2.1