Revert "rabbit: Don't prefetch when batch_size is set"

This reverts commit c881baed29.

Eventhough batch_size is set, rabbitMQ prefetch count is not changed
at the first time of connection creation. It works only connection reset
cases(i.e. rabbitMQ restart). So this patch can not fix original issue
  https://bugs.launchpad.net/ceilometer/+bug/1551667

Moreover, it makes another bug that messages of sameple queues are not
consumed properly. So revert it.

Change-Id: Ia8ebee8e2a670e46b6a68859bc30e717bd56ed7e
Signed-off-by: Wonil Choi <wonil22.choi@samsung.com>
Closes-bug: 1759755
This commit is contained in:
Wonil Choi 2018-03-28 09:55:07 +09:00 committed by Wonil Choi
parent f7c8e7bfc1
commit e0e8a1ea68
1 changed files with 0 additions and 6 deletions

View File

@ -582,12 +582,6 @@ class AMQPDriverBase(base.BaseDriver):
def listen_for_notifications(self, targets_and_priorities, pool,
batch_size, batch_timeout):
conn = self._get_connection(rpc_common.PURPOSE_LISTEN)
# NOTE(sileht): The application set batch_size, so we don't need to
# prefetch more messages, especially for notifications. Notifications
# queues can be really big when the consumer have disapear during a
# long period, and when it come back, kombu/pyamqp will fetch all
# messages it can. So we override the default qos prefetch value
conn.connection.rabbit_qos_prefetch_count = batch_size
listener = AMQPListener(self, conn)
for target, priority in targets_and_priorities: