summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-04-16 17:38:03 +0100
committerMatthew Sackman <matthew@lshift.net>2010-04-16 17:38:03 +0100
commitf92a772f6b759945b17c01dca29f5c611b27b46d (patch)
tree12cd51cc58ab3069178f128377f2109b5e1223ff /src
parent092187dee9b4cb5c5c86bf38eb4d1d4a13978dbb (diff)
downloadrabbitmq-server-git-f92a772f6b759945b17c01dca29f5c611b27b46d.tar.gz
On commit we must know about the channel
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index f6d3d1a517..720d390abf 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -470,15 +470,12 @@ maybe_run_queue_via_backing_queue(Fun, State = #q{backing_queue_state = BQS}) ->
commit_transaction(Txn, From, ChPid, State = #q{backing_queue = BQ,
backing_queue_state = BQS}) ->
{AckTags, BQS1} = BQ:tx_commit(Txn, From, BQS),
- case lookup_ch(ChPid) of
- not_found ->
- [];
- C = #cr{unacked_messages = UAM} ->
- Remaining = ordsets:to_list(ordsets:subtract(
- ordsets:from_list(UAM),
- ordsets:from_list(AckTags))),
- store_ch_record(C#cr{unacked_messages = Remaining, txn = none})
- end,
+ %% ChPid must be known here because of the participant management
+ %% by the channel.
+ C = #cr{unacked_messages = UAM} = lookup_ch(ChPid),
+ Remaining = ordsets:to_list(ordsets:subtract(ordsets:from_list(UAM),
+ ordsets:from_list(AckTags))),
+ store_ch_record(C#cr{unacked_messages = Remaining, txn = none}),
State#q{backing_queue_state = BQS1}.
rollback_transaction(Txn, ChPid, State = #q{backing_queue = BQ,