Merge "Remove the max_send_retries option" into feature/amqp-dispatch-router

This commit is contained in:
Jenkins 2016-08-06 20:44:39 +00:00 committed by Gerrit Code Review
commit cdd279b516
4 changed files with 5 additions and 18 deletions

View File

@ -811,9 +811,6 @@ class Controller(pyngus.ConnectionEventHandler):
self.conn_retry_interval_max = \
config.oslo_messaging_amqp.connection_retry_interval_max
self.link_retry_delay = config.oslo_messaging_amqp.link_retry_delay
self.max_send_retries = config.oslo_messaging_amqp.max_send_retries
if self.max_send_retries <= 0:
self.max_send_retries = None # None or 0 == forever, like rabbit
_opts = config.oslo_messaging_amqp
factory_args = {"legacy_server_prefix": _opts.server_request_prefix,
@ -883,7 +880,7 @@ class Controller(pyngus.ConnectionEventHandler):
return
LOG.debug("Sending message to %s", send_task.target)
if send_task.retry is None or send_task.retry < 0:
send_task.retry = self.max_send_retries
send_task.retry = None
key = keyify(send_task.target, send_task.service)
sender = self._senders.get(key)
if not sender:

View File

@ -105,13 +105,6 @@ amqp1_opts = [
# Message send retry and timeout options
cfg.IntOpt('max_send_retries',
default=0,
min=0,
help='Maximum attempts to re-send a message that failed due to'
' a recoverable error. Default is 0 (retry forever or until'
' timeout expires).'),
cfg.IntOpt('link_retry_delay',
default=10,
min=1,

View File

@ -278,8 +278,7 @@ class ProtonDriver(base.BaseDriver):
:param envelope: Encapsulate message in an envelope
:type envelope: bool
:param retry: (optional) maximum re-send attempts on recoverable error
None or -1 means to use value of max_send_retries
configuration option
None or -1 means to retry forever
0 means no retry
N means N retries
:type retry: int
@ -329,8 +328,7 @@ class ProtonDriver(base.BaseDriver):
:param version: message envelope version
:type version: float
:param retry: (optional) maximum re-send attempts on recoverable error
None or -1 means to use value of max_send_retries
configuration option
None or -1 means to retry forever
0 means no retry
N means N retries
:type retry: int

View File

@ -903,8 +903,7 @@ class TestLinkRecovery(_AmqpBrokerTestCase):
self._broker.on_receiver_active = on_active
self._broker.start()
self.config(max_send_retries=retries,
link_retry_delay=1,
self.config(link_retry_delay=1,
group="oslo_messaging_amqp")
driver = amqp_driver.ProtonDriver(self.conf, self._broker_url)
target = oslo_messaging.Target(topic="test-topic")
@ -915,7 +914,7 @@ class TestLinkRecovery(_AmqpBrokerTestCase):
try:
rc = driver.send(target, {"context": "whatever"},
{"method": "echo", "id": "e1"},
wait_for_reply=True)
wait_for_reply=True, retry=retries)
self.assertIsNotNone(rc)
self.assertEqual(rc.get('correlation-id'), 'e1')
except Exception: