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
This commit is contained in:
parent
fd2381c723
commit
0602d1a10a
@ -37,7 +37,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
# Maximum should be small enough to not get rejected ack,
|
# Maximum should be small enough to not get rejected ack,
|
||||||
# minimum should be big enough to not burn the CPU.
|
# minimum should be big enough to not burn the CPU.
|
||||||
ACK_REQUEUE_EVERY_SECONDS_MIN = 0.001
|
ACK_REQUEUE_EVERY_SECONDS_MIN = 0.001
|
||||||
ACK_REQUEUE_EVERY_SECONDS_MAX = 1.0
|
ACK_REQUEUE_EVERY_SECONDS_MAX = 5.0
|
||||||
|
|
||||||
|
|
||||||
class MessageOperationsHandler(object):
|
class MessageOperationsHandler(object):
|
||||||
|
@ -106,9 +106,11 @@ rabbit_opts = [
|
|||||||
),
|
),
|
||||||
cfg.FloatOpt('kombu_reconnect_delay',
|
cfg.FloatOpt('kombu_reconnect_delay',
|
||||||
default=1.0,
|
default=1.0,
|
||||||
|
min=0.0,
|
||||||
|
max=amqpdriver.ACK_REQUEUE_EVERY_SECONDS_MAX * 0.9,
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
help='How long to wait before reconnecting in response to an '
|
help='How long to wait (in seconds) before reconnecting in '
|
||||||
'AMQP consumer cancel notification.'),
|
'response to an AMQP consumer cancel notification.'),
|
||||||
cfg.StrOpt('kombu_compression',
|
cfg.StrOpt('kombu_compression',
|
||||||
help="EXPERIMENTAL: Possible values are: gzip, bz2. If not "
|
help="EXPERIMENTAL: Possible values are: gzip, bz2. If not "
|
||||||
"set compression will not be used. This option may not "
|
"set compression will not be used. This option may not "
|
||||||
|
@ -70,7 +70,7 @@ class TestConfigOptsProxy(test_utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_invalid_value(self):
|
def test_invalid_value(self):
|
||||||
group = 'oslo_messaging_rabbit'
|
group = 'oslo_messaging_rabbit'
|
||||||
self.config(kombu_reconnect_delay=5.0,
|
self.config(kombu_reconnect_delay=1.0,
|
||||||
group=group)
|
group=group)
|
||||||
url = transport.TransportURL.parse(
|
url = transport.TransportURL.parse(
|
||||||
self.conf, "rabbit:///?kombu_reconnect_delay=invalid_value"
|
self.conf, "rabbit:///?kombu_reconnect_delay=invalid_value"
|
||||||
|
9
releasenotes/notes/bug-1993149-e8b231791b65e938.yaml
Normal file
9
releasenotes/notes/bug-1993149-e8b231791b65e938.yaml
Normal 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.
|
Loading…
x
Reference in New Issue
Block a user