summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-07-26 16:23:00 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-07-26 16:23:00 +0100
commit5c8f4940bd021364f823d20c9a6fad843a3f5b3b (patch)
treeb364310488fc81bde281f624106df08af333be5c
parent4bd844b22f15ab1d73914a7210622a87b32a40df (diff)
parentf37aed126d810e623b41f6a0eade002eec4c3b16 (diff)
downloadrabbitmq-server-5c8f4940bd021364f823d20c9a6fad843a3f5b3b.tar.gz
Merging bug23464 to default
-rw-r--r--src/rabbit_backing_queue_qc.erl2
-rw-r--r--src/rabbit_channel.erl14
-rw-r--r--src/rabbit_mirror_queue_coordinator.erl2
-rw-r--r--src/rabbit_mirror_queue_master.erl4
-rw-r--r--src/rabbit_mirror_queue_misc.erl2
-rw-r--r--src/rabbit_mirror_queue_slave.erl2
-rw-r--r--src/rabbit_mirror_queue_slave_sup.erl2
-rw-r--r--src/rabbit_reader.erl1
-rw-r--r--src/rabbit_tests.erl10
9 files changed, 26 insertions, 13 deletions
diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl
index 93e8efad..d358a041 100644
--- a/src/rabbit_backing_queue_qc.erl
+++ b/src/rabbit_backing_queue_qc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2011-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_backing_queue_qc).
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 8310bd8e..f398fcc5 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1131,10 +1131,16 @@ 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} =
+ case Reason of
+ Reason when Reason =:= noproc; Reason =:= noconnection;
+ Reason =:= normal; Reason =:= shutdown ->
+ {false, fun record_confirms/2};
+ {shutdown, _} ->
+ {false, fun record_confirms/2};
+ _ ->
+ {true, fun send_nacks/2}
+ end,
{MXs, State2} = process_confirms(MsgSeqNos, QPid, Nack, State1),
erase_queue_stats(QPid),
State3 = SendFun(MXs, State2),
diff --git a/src/rabbit_mirror_queue_coordinator.erl b/src/rabbit_mirror_queue_coordinator.erl
index a347904c..f6664a27 100644
--- a/src/rabbit_mirror_queue_coordinator.erl
+++ b/src/rabbit_mirror_queue_coordinator.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2010 VMware, Inc. All rights reserved.
+%% Copyright (c) 2010-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_mirror_queue_coordinator).
diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl
index 41748c15..532911f2 100644
--- a/src/rabbit_mirror_queue_master.erl
+++ b/src/rabbit_mirror_queue_master.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2010 VMware, Inc. All rights reserved.
+%% Copyright (c) 2010-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_mirror_queue_master).
@@ -298,7 +298,7 @@ is_duplicate(Message = #basic_message { id = MsgId },
error ->
%% We permit the underlying BQ to have a peek at it, but
%% only if we ourselves are not filtering out the msg.
- {Result, BQS1} = BQ:is_duplicate(none, Message, BQS),
+ {Result, BQS1} = BQ:is_duplicate(Message, BQS),
{Result, State #state { backing_queue_state = BQS1 }};
{ok, published} ->
%% It already got published when we were a slave and no
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 4761f79e..6a9f733e 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2010 VMware, Inc. All rights reserved.
+%% Copyright (c) 2010-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_mirror_queue_misc).
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 93340ba8..b38a8967 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2010 VMware, Inc. All rights reserved.
+%% Copyright (c) 2010-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_mirror_queue_slave).
diff --git a/src/rabbit_mirror_queue_slave_sup.erl b/src/rabbit_mirror_queue_slave_sup.erl
index 2ce5941e..879a6017 100644
--- a/src/rabbit_mirror_queue_slave_sup.erl
+++ b/src/rabbit_mirror_queue_slave_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2010 VMware, Inc. All rights reserved.
+%% Copyright (c) 2010-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_mirror_queue_slave_sup).
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index f5214a77..dffabf85 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -677,7 +677,6 @@ handle_method0(#'connection.tune_ok'{frame_max = FrameMax,
end;
handle_method0(#'connection.open'{virtual_host = VHostPath},
-
State = #v1{connection_state = opening,
connection = Connection = #connection{
user = User,
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 63676fef..2e454411 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -1672,6 +1672,10 @@ test_backing_queue() ->
passed = test_queue_recover(),
application:set_env(rabbit, queue_index_max_journal_entries,
MaxJournal, infinity),
+ %% We will have restarted the message store, and thus changed
+ %% the order of the children of rabbit_sup. This will cause
+ %% problems if there are subsequent failures - see bug 24262.
+ ok = restart_app(),
passed;
_ ->
passed
@@ -1911,6 +1915,10 @@ with_empty_test_queue(Fun) ->
{0, Qi} = init_test_queue(),
rabbit_queue_index:delete_and_terminate(Fun(Qi)).
+restart_app() ->
+ rabbit:stop(),
+ rabbit:start().
+
queue_index_publish(SeqIds, Persistent, Qi) ->
Ref = rabbit_guid:guid(),
MsgStore = case Persistent of
@@ -2150,7 +2158,7 @@ wait_for_confirms(Unconfirmed) ->
wait_for_confirms(
gb_sets:difference(Unconfirmed,
gb_sets:from_list(Confirmed)))
- after 1000 -> exit(timeout_waiting_for_confirm)
+ after 5000 -> exit(timeout_waiting_for_confirm)
end
end.