summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-07-21 13:44:30 +0100
committerMatthew Sackman <matthew@lshift.net>2009-07-21 13:44:30 +0100
commit21d96ff7298e027d954bdd0058d0adaffebfa36a (patch)
tree6fd44466e30feff48ddbbcc874bd889796a6a906
parent1c003c407e9c727189343a97a5f80d036914bb0c (diff)
downloadrabbitmq-server-git-21d96ff7298e027d954bdd0058d0adaffebfa36a.tar.gz
sigh, another stupid bug which none of the tests catch and which I just happened to spot by reading the code. I am deeply alarmed by how many of these sorts of bugs I am finding and how many more there must be. OTOH, they do seem to crop up much more in code which has been changed substantially and repeatedly, though it's very possible that's just because I'm looking there more than elsewhere.
-rw-r--r--src/rabbit_mixed_queue.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_mixed_queue.erl b/src/rabbit_mixed_queue.erl
index afc1c8aae1..d2d3c19f75 100644
--- a/src/rabbit_mixed_queue.erl
+++ b/src/rabbit_mixed_queue.erl
@@ -159,7 +159,7 @@ send_messages_to_disk(IsDurable, Q, Queue, PublishCount, RequeueCount,
case IsDurable andalso IsPersistent of
true -> %% it's already in the Q
send_messages_to_disk(
- IsDurable, Q, Queue1, PublishCount, RequeueCount,
+ IsDurable, Q, Queue1, PublishCount, RequeueCount + 1,
Commit, inc_queue_length(Q, MsgBuf, 1));
false ->
Commit1 = flush_requeue_to_disk_queue
@@ -181,7 +181,7 @@ send_messages_to_disk(IsDurable, Q, Queue, PublishCount, RequeueCount,
end;
{{value, {Q, Count}}, Queue1} ->
send_messages_to_disk(IsDurable, Q, Queue1, PublishCount,
- RequeueCount, Commit,
+ RequeueCount + Count, Commit,
inc_queue_length(Q, MsgBuf, Count))
end.