summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-05-07 15:20:40 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-05-07 15:20:40 +0100
commit23de2b4e37beee15d70b9095ff781014e4cf03c2 (patch)
tree0630ace2c6411244dbade7c57c6f83f86f6432fa
parent8b560d061e9dd8872261a393d5987fb92173d8a1 (diff)
downloadrabbitmq-server-23de2b4e37beee15d70b9095ff781014e4cf03c2.tar.gz
Remove assertion; it's not always correct if prefetch has been set before. Instead, only set the volume when we have not set prefetch before.
-rw-r--r--src/rabbit_limiter.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl
index d9f1170e..1e32f95a 100644
--- a/src/rabbit_limiter.erl
+++ b/src/rabbit_limiter.erl
@@ -324,12 +324,12 @@ prioritise_call(_Msg, _From, _Len, _State) -> 0.
handle_call({new, ChPid}, _From, State = #lim{ch_pid = undefined}) ->
{reply, ok, State#lim{ch_pid = ChPid}};
-handle_call({limit_prefetch, PrefetchCount, UnackedCount}, _From, State) ->
- %% assertion
- true = State#lim.prefetch_count == 0 orelse
- State#lim.volume == UnackedCount,
+handle_call({limit_prefetch, PrefetchCount, UnackedCount}, _From,
+ State = #lim{prefetch_count = 0}) ->
{reply, ok, maybe_notify(State, State#lim{prefetch_count = PrefetchCount,
volume = UnackedCount})};
+handle_call({limit_prefetch, PrefetchCount, _UnackedCount}, _From, State) ->
+ {reply, ok, maybe_notify(State, State#lim{prefetch_count = PrefetchCount})};
handle_call(unlimit_prefetch, _From, State) ->
{reply, ok, maybe_notify(State, State#lim{prefetch_count = 0,