Publishing a message using the kombu connection autoretry method may
allow exceptions from the py-amqp library to be raised up to the
application. This does not conform to the documented oslo.messaging
API.
Enhance the try except block to capture any exception and translate it
into a MessageDeliveryFailure.
There are a few cases where exceptions will be raised during autoretry
publishing: recoverable connection or channel errors, and
non-recoverable connection or channel errors.
autoretry will only retry if the error is recoverable. Non recoverable
errors are re-raised immediately regardless of the retry count.
In the case of a recoverable error it seems unlikely that retrying
either the connection or the channel yet again is going to get us
anywhere, so in this case we simply clean up the channel state, log an
error and fail the operation.
In the case of non-recoverable error we are out of luck (think
authentication failure) - further retrying will not help. Best we can
do is clean up state and log the heck out of it.
Change-Id: I2f65d2ee19a8c3e9a323b30404abbf0cbb45a216
Closes-Bug: #1705351
Closes-Bug: #1707160
In testcase, setUp will be called automatically. This patch used
to remove setUp functions that do nothing. Besides, it will keep
code clean.
Change-Id: I2bf79884704974dc00196816f7de43580b474d3e
This test removes a check of the number of times kombu's
Connection.connect() method is being called for each mocked retry.
The number of calls kombu makes internally is irrelevant to proving
the API is correct. The rest of the tests do ensure that the target
method is retried as expected, which is relevant to the API.
This change is necessary due to the kombu v4.1.0 release actually
calling Connection.connect() twice for each call to the target method
when compaired to earlier releases.
Change-Id: I3326b8e92efe3bef00b1f389d81944af9cc080f8
Closes-Bug: #1707263
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None
Change-Id: I54b4b950dfcd2ce5a64f38b5d5b5cbe95846a8fa
html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.
Change-Id: Ifde17e94d0345a289eea29ba3d664d31f1eb51d9
Closes-Bug:#1693670
We recently move ack/requeue of messages in main/polling thread
of rabbitmq drivers. And break the blocking executor.
This one is not tested by any tests and now deprecated.
This change workaround the issue until we completely remove the
blocking executor.
Change-Id: Id479100f6ff364cf67a199e9b70f9f0c7bf7e1a9
Closes-bug: #1694728
The trove metadata for this package claims to support both Python
2.x and Py3K; build universal wheels so Python 3.x interpreters can
consume them too.
Change-Id: I0b88fcaa2ea36e1d7478d76b86c6c1f1e68c8616
The serializer tests occasionally fail since the order of a dict() is
not guaranteed. Explicitly compute the serializer instead of
pre-computing it.
Change-Id: I74f8fa227e6508491b5982fe7e2841683724540c
Using blocking executor is not recommended for application. But it looks
like some use it just because it's the default and are not aware their
should change it despite of documentation and logging message.
Choosing the application threading model is an important step
of an application.
This change deprecates it, in the future we will just make executor
mandatory. This will ensure that application make a choice.
Also this will reduce headache of oslo.messaging developers to
make the driver code working in a sync and async.
And to finish test coverage of blocking executor is 0%...
This rework some tests to remove logging.captureWarnings() that can
catch unwanted warning of other tests. Tests mocks warning instead.
Related-bug: #694728
Change-Id: Ic67164d12e7a9bed76d6e64ca2ced12e3984ff5f
Be specific regarding which characters can be used in the 'username'
and 'password' fields of the URL.
Change-Id: I9a2a801b3dd86fceffb05f4d52c715748c88d0cb
Closes-Bug: #1693967