summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-07-18 16:04:13 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-07-18 16:04:13 +0100
commite8f859942c65517e9708ea34ec84c927f03a126c (patch)
tree6cadfe7089de4e85be67349f85b6e8a4bc017cff /src
parentac52ab814f787ba752cb16269092b9af38a7d904 (diff)
downloadrabbitmq-server-git-e8f859942c65517e9708ea34ec84c927f03a126c.tar.gz
there are many ways for a queue to die nicely
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 8310bd8eb5..65905906af 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1131,10 +1131,13 @@ handle_publishing_queue_down(QPid, Reason, State = #ch{unconfirmed_qm = UQM}) ->
%% process_confirms to prevent each MsgSeqNo being removed from
%% the set one by one which which would be inefficient
State1 = State#ch{unconfirmed_qm = gb_trees:delete_any(QPid, UQM)},
- {Nack, SendFun} = case Reason of
- normal -> {false, fun record_confirms/2};
- _ -> {true, fun send_nacks/2}
- end,
+ {Nack, SendFun} =
+ if (Reason =:= noproc orelse Reason =:= nodedown orelse
+ Reason =:= normal orelse Reason =:= shutdown) ->
+ {false, fun record_confirms/2};
+ true ->
+ {true, fun send_nacks/2}
+ end,
{MXs, State2} = process_confirms(MsgSeqNos, QPid, Nack, State1),
erase_queue_stats(QPid),
State3 = SendFun(MXs, State2),