diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-04-03 20:15:36 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-04-03 20:15:36 +0100 |
commit | 06059ad7b6b55d267aeb43af851a3bced312e70b (patch) | |
tree | c32ebe37a72293cedf361e2e1176ee576d12a576 | |
parent | 363f7a6aad12282b2c87983145c00b0c2f7faad9 (diff) | |
download | rabbitmq-server-06059ad7b6b55d267aeb43af851a3bced312e70b.tar.gz |
revise nack handling in queue (for dlx)
- with the changes introduced in bug 24750, the "lost" message count
logged was misleading since it would not include any messages still
pending confirmation from other queues. Fix that.
- normal queue terminations are not log worthy
- splitting log information across two entries loses context,
i.e. other log entries might appear inbetween. So now we collate all
the information into a single log entry.
- saying that messages were "lost" is misleading - we simply don't
know what happened to them. Make this clear(er).
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 19e1736a..21e576a6 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -757,15 +757,14 @@ handle_queue_down(QPid, Reason, State = #q{queue_monitors = QMons, error -> noreply(State); {ok, _} -> - rabbit_log:info("DLQ ~p (for ~s) died~n", - [QPid, rabbit_misc:rs(qname(State))]), - {MsgSeqNoAckTags, UC1} = dtree:take(QPid, UC), - case (MsgSeqNoAckTags =/= [] andalso - rabbit_misc:is_abnormal_termination(Reason)) of - true -> rabbit_log:warning("Dead queue lost ~p messages~n", - [length(MsgSeqNoAckTags)]); + case rabbit_misc:is_abnormal_termination(Reason) of + true -> {Lost, _UC1} = dtree:take_all(QPid, UC), + rabbit_log:warning( + "DLQ ~p for ~s died with ~p unconfirmed messages~n", + [QPid, rabbit_misc:rs(qname(State)), length(Lost)]); false -> ok end, + {MsgSeqNoAckTags, UC1} = dtree:take(QPid, UC), cleanup_after_confirm( [AckTag || {_MsgSeqNo, AckTag} <- MsgSeqNoAckTags], State#q{queue_monitors = dict:erase(QPid, QMons), |