summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2009-06-10 15:30:49 +0100
committerMatthias Radestock <matthias@lshift.net>2009-06-10 15:30:49 +0100
commit73cc475f11642f617ac5ba80e187db1b03da76ec (patch)
tree803a1192ee310507a879d34dbbd7a03ab515a4bc
parent909bfbe81055ed684aba44be52066637393c2293 (diff)
downloadrabbitmq-server-bug20955.tar.gz
respect channel blocking when adding consumersbug20955
-rw-r--r--src/rabbit_amqqueue_process.erl15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 41c2d101..f8cfddf1 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -644,11 +644,18 @@ handle_call({basic_consume, NoAck, ReaderPid, ChPid, LimiterPid,
true -> ExistingHolder
end,
State1 = State#q{has_had_consumers = true,
- exclusive_consumer = ExclusiveConsumer,
- round_robin = queue:in({ChPid, Consumer},
- RoundRobin)},
+ exclusive_consumer = ExclusiveConsumer},
ok = maybe_send_reply(ChPid, OkMsg),
- reply(ok, run_poke_burst(State1))
+ State2 =
+ case is_ch_blocked(C) of
+ true -> State1;
+ false -> run_poke_burst(
+ State1#q{
+ round_robin = queue:in(
+ {ChPid, Consumer},
+ RoundRobin)})
+ end,
+ reply(ok, State2)
end
end;