Increase ACK_REQUEUE_EVERY_SECONDS_MAX to exceed default kombu_reconnect_delay

Previously the two values were the same; this caused us
to always exceed the timeout limit ACK_REQUEUE_EVERY_SECONDS_MAX
which results in various code paths never being traversed
due to premature timeout exceptions.

Also apply min/max values to kombu_reconnect_delay so it doesn't
exceed ACK_REQUEUE_EVERY_SECONDS_MAX and break things again.

Closes-Bug: #1993149
Change-Id: I103d2aa79b4bd2c331810583aeca53e22ee27a49
(cherry picked from commit 0602d1a10a)
(cherry picked from commit b4b49248bc)
(cherry picked from commit fa3195a345)
(cherry picked from commit ee6923c07c)
This commit is contained in:
Andrew Bogott
2022-12-05 09:25:00 -06:00
committed by Takashi Kajinami
parent 49ec24c179
commit ae7d6d28aa
4 changed files with 15 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ LOG = logging.getLogger(__name__)
# Maximum should be small enough to not get rejected ack,
# minimum should be big enough to not burn the CPU.
ACK_REQUEUE_EVERY_SECONDS_MIN = 0.001
ACK_REQUEUE_EVERY_SECONDS_MAX = 1.0
ACK_REQUEUE_EVERY_SECONDS_MAX = 5.0
class MessageOperationsHandler(object):

View File

@@ -100,9 +100,11 @@ rabbit_opts = [
deprecated_for_removal=True),
cfg.FloatOpt('kombu_reconnect_delay',
default=1.0,
min=0.0,
max=amqpdriver.ACK_REQUEUE_EVERY_SECONDS_MAX * 0.9,
deprecated_group='DEFAULT',
help='How long to wait before reconnecting in response to an '
'AMQP consumer cancel notification.'),
help='How long to wait (in seconds) before reconnecting in '
'response to an AMQP consumer cancel notification.'),
cfg.StrOpt('kombu_compression',
help="EXPERIMENTAL: Possible values are: gzip, bz2. If not "
"set compression will not be used. This option may not "

View File

@@ -70,7 +70,7 @@ class TestConfigOptsProxy(test_utils.BaseTestCase):
def test_invalid_value(self):
group = 'oslo_messaging_rabbit'
self.config(kombu_reconnect_delay=5.0,
self.config(kombu_reconnect_delay=1.0,
group=group)
url = transport.TransportURL.parse(
self.conf, "rabbit:///?kombu_reconnect_delay=invalid_value"

View File

@@ -0,0 +1,9 @@
---
upgrade:
- |
If kombu_reconnect_delay is specified in the [oslo_messaging_rabbit] section,
ensure that it is less than 5.0, the value of ACK_REQUEUE_EVERY_SECONDS_MAX
fixes:
- |
Increased ACK_REQUEUE_EVERY_SECONDS_MAX to resolve issues with rabbitmq HA
failover.