summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-06-27 12:49:10 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-06-27 12:49:10 +0100
commit8907aa7c8cebb20f7208a50944e2c8f0461f2d21 (patch)
tree61e5887b8b31d0d3173f8cbf347d59ec2b5f9f5b
parent09f2662b458c32bf714491d0a4f217ebf1d026a6 (diff)
downloadrabbitmq-server-git-8907aa7c8cebb20f7208a50944e2c8f0461f2d21.tar.gz
Recreate that assertion up one level in the call stack, since the callers may still care about it even though VQ itself does not.
-rw-r--r--src/rabbit_amqqueue_process.erl1
-rw-r--r--src/rabbit_mirror_queue_slave.erl1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index c790a12df7..f71e28e1b0 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -540,6 +540,7 @@ attempt_delivery(Delivery = #delivery{sender = SenderPid, message = Message},
{false, BQS1} ->
deliver_msgs_to_consumers(
fun (true, State1 = #q{backing_queue_state = BQS2}) ->
+ 0 = BQ:len(BQS2),
{AckTag, BQS3} = BQ:publish_delivered(
Message, Props, SenderPid, BQS2),
{{Message, Delivered, AckTag},
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 964b0eb4f9..a2ea2c42d7 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -724,6 +724,7 @@ process_instruction({publish_delivered, ChPid, MsgProps,
Msg = #basic_message { id = MsgId }}, State) ->
State1 = #state { backing_queue = BQ, backing_queue_state = BQS } =
publish_or_discard(published, ChPid, MsgId, State),
+ 0 = BQ:len(BQS),
{AckTag, BQS1} = BQ:publish_delivered(Msg, MsgProps, ChPid, BQS),
{ok, maybe_store_ack(true, MsgId, AckTag,
State1 #state { backing_queue_state = BQS1 })};