Merge "Fix ignored [notification] batch_size"

This commit is contained in:
Zuul 2021-12-14 12:06:38 +00:00 committed by Gerrit Code Review
commit a3e5aacc0b
3 changed files with 21 additions and 4 deletions

View File

@ -44,10 +44,13 @@ OPTS = [
"notifications go to rabbit-nova:5672, while all "
"cinder notifications go to rabbit-cinder:5672."),
cfg.IntOpt('batch_size',
default=100, min=1,
default=1, min=1,
help='Number of notification messages to wait before '
'publishing them. Batching is advised when transformations are '
'applied in pipeline.'),
'publishing them.'),
cfg.IntOpt('batch_timeout',
help='Number of seconds to wait before dispatching samples '
'when batch_size is not reached (None means indefinitely).'
),
cfg.IntOpt('workers',
default=1,
min=1,
@ -138,7 +141,9 @@ class NotificationService(cotyledon.Service):
# NOTE(gordc): ignore batching as we want pull
# to maintain sequencing as much as possible.
listener = messaging.get_batch_notification_listener(
transport, targets, endpoints, allow_requeue=True)
transport, targets, endpoints, allow_requeue=True,
batch_size=self.conf.notification.batch_size,
batch_timeout=self.conf.notification.batch_timeout)
listener.start(
override_pool_size=self.conf.max_parallel_requests
)

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``[notification] batch_size`` parameter has been deprecated.
The parameter has not used since the Stein release.

View File

@ -0,0 +1,7 @@
---
fixes:
- |
The ``[notification] batch_size`` parameter now takes effect to enable
batch processing of notifications. The ``[notification] batch_timeout``
parameter has been restored at the same time to determine how much and
how long notifications are kept.