diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-05-02 14:17:10 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-05-02 14:17:10 +0100 |
commit | 085b02a3b2decca20e5d14288f87097aea9852e1 (patch) | |
tree | dedc25cd0ebab5519138edbc840ec3d6f1025558 | |
parent | 0c9b98ffbbc06395c46c2b2b909b6548b8648f6e (diff) | |
download | rabbitmq-server-bug25541.tar.gz |
prioritise notify_sentbug25541
but only when the queue is empty.
That way we get the benefits of prioritisation - avoiding unnecessary
enqueuing of messages - without the downsides - stalling producers.
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 066392f8..bdb9a6f6 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -1018,12 +1018,17 @@ prioritise_call(Msg, _From, _Len, _State) -> _ -> 0 end. -prioritise_cast(Msg, _Len, _State) -> +prioritise_cast(Msg, _Len, State) -> case Msg of delete_immediately -> 8; {set_ram_duration_target, _Duration} -> 8; {set_maximum_since_use, _Age} -> 8; {run_backing_queue, _Mod, _Fun} -> 6; + {notify_sent, _ChPid, _Credit} -> + case is_empty(State) of + true -> 3; + false -> 0 + end; _ -> 0 end. |