Basic functional and unit tests for zmq driver.
Note as the zmq driver is directly dependent on eventlet, this
change also updates the notify logger tests to remove the
direct dependency on threading which was being monkey patched,
causing test failures.
As the zmq driver has a direct dependency on eventlet, tests are
skipped under py3.
Co-Authored-By: Kapil Thangavelu <kapil.thangavelu@canonical.com>
Co-Authored-By: Edward Hope-Morley <edward.hope-morley@canonical.com>
Change-Id: I93b8b2e92d0f2a353d3357a5e61f6d472ec84944
Partial-bug: #1302941
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.
Change-Id: I1ba19377ed279ccb9f8d698b15678c528cbeade3
This change reintroduces the fake_rabbit only for backward compatibility,
but mark it as deprecated.
Now, to use the kombu in-memory driver (that is not thread safe) we must
set the transport_url config option to 'kombu+memory:////" or the
rpc_backend to kombu+memory.
Or we can use the fake driver of oslo.messaging by setting the
transport_url to 'fake:///' or the rpc_backend to 'fake'
This is effectively reverting commit bcb3b23b8f6e7d01e38fdc031982558711bb7586.
Closes-bug: #1399085
Change-Id: I7b6fb3811fc6f695f75ecd350e04e69afd26c428
Add the missing 's' for the message format and
just print the number queues instead of print a list
full of '<object object at 0xXXXXXXXXXX>'.
Change-Id: Idaab4057bc6a41523a1944ae0c8e15e5e885b390
The iterconsume method of the rabbit driver must
honor timeout parameter when reconnection to the broker
occurs.
Change-Id: I666d818449750c6bae9dde02f519842687a8e4fa
This removes a TODO and also fixes a issue due to the
global state of oslo.config.cfg.CONF.
Closes bug: #1397339
Change-Id: Ib366f35678f899fda93821e6f07897baf8f631b4
Each driver instance must use it's own connection pool.
This removes the last global state of qpid and rabbitmq driver
Make the relation between classes more simple.
The previous behavior was not very safe, as explained in the bug report.
And also, this is a first step to replace this custom connection pool
handling by the kombu one.
Closes bug: #1397925
Partial bug: #1397339
Change-Id: Iecd2b39c76417d9ac081d46810f72eb6e38edfda
In the listener pool test, we must wait that all expected messages
have been receive before stopping the listener.
Closes bug: #1397338
Change-Id: I5e4b39b54e3b99c014f5f9c77926108b90f94192
Depending of the order of the tests executions, the driver can be the
previous configured one. But some tests are written to work on a
specific driver
This change sets the fake driver by default.
It also removes useless mock in test_log_handler.
Change-Id: Ic49bb9aec2e537e55a98315eba8dc97fbb18f96b
This change allows to stop the eventlet executor without
using eventlet.kill.
And also, the kombu docs actually recommend that drain_events
by default have a 1 timeout.
Co-Authored-by: Joshua Harlow <harlowja@yahoo-inc.com>
Change-Id: I3a3919e38d08267439843a127346300fd2131540
Currently it appears the timeout provided to the wait()
method will be reused X number of times (where X may be
indeterminate depending on reconnections, loss of messages
and so-on) so instead of reusing it which can potentially
result in a infinite number of calls have a new object be
used that will cause the subsequent timeouts used elsewhere
in the wait function to actually decay correctly.
Closes-bug: #1379394
Change-Id: I12c4ea1eef6b857d12246db0483adaf7c87e740c
This change warns the library consumer when the process if forked and
we can't be sure that the library work as expected.
This also add some documentation about forking oslo.messaging Transport
object.
Change-Id: I2938421775aa72866adac198d70214856d45e165
Related-bug: #1330199
For greater clarity, that the class is related to logging, PublishErrorsHandler
renamed to LoggingErrorNotificationHandler. Included an alias from the
old name to the new class for backwards-compatibility.
Change-Id: Iae8e26901bab6d5aa7532add31b49a4345b067fe
Closes-Bug: #1287420
Retry Queue creation to workaround race condition
that may happen when both the client and broker race over
exchange creation and deletion respectively which happen only
when the Queue/Exchange were created with auto-delete flag.
Queues/Exchange declared with auto-delete instruct the Broker to
delete the Queue when the last Consumer disconnect from it, and
the Exchange when the last Queue is deleted from this Exchange.
Now in a RabbitMQ cluster setup, if the cluster node that we are
connected to go down, 2 things will happen:
1. From RabbitMQ side, the Queues w/ auto-delete will be deleted
from the other cluster nodes and then the Exchanges that the
Queues are bind to if they were also created w/ auto-delete.
2. From client side, client will reconnect to another cluster
node and call queue.declare() which create Exchanges then
Queues then Binding in that order.
Now in a happy path the queues/exchanges will be deleted from the
broker before client start re-creating them again, but it also
possible that the client first start by creating queues/exchange
as part of the queue.declare() call, which are no-op operations
b/c they alreay existed, but before it could bind Queue to
Exchange, RabbitMQ nodes just received the 'signal' that the
queue doesn't have any consumer so it should be delete, and the
same with exchanges, which will lead to binding fail with
NotFound error.
Illustration of the time line from Client and RabbitMQ cluster
respectively when the race condition happen:
e-declare(E) q-declare(Q) q-bind(Q, E)
-----+------------------+----------------+----------->
e-delete(E)
------------------------------+---------------------->
Change-Id: Ideb73af6f246a8282780cdb204d675d5d4555bf0
Closes-Bug: #1318721
This patch attempts to deal with applications that have forked the
process after connecting to the broker. First, the creation of the
connection is delayed until the application attempts to perform a
messaging operation. Second, each time the application performs a
messaging operation the current process id is checked against the id
of the process that created the connection. If the process ids do not
match, the application has called os.fork(). The new child process
discards the existing connection and creates a new one.
Change-Id: I5455cb0f8d380d6b65f1268b34a91355cbb14aa2
Closes-Bug: #1392868
The PROTOCOL_SSLv3 should not be used, as it can be exploited with
a protocol downgrade attack. Also, its support has been removed in
Debian, so it simply doesn't work at all now in Sid.
This patch removes PROTOCOL_SSLv3 from one of the possible protocols
used by oslo.messaging.
Closes-Bug: #1395095
Change-Id: I2c1977c3bfc1923bcb03744e909f2e70c7fdb14c
This change adds two targets for qpid and amqp to
be able to run the functional tests suite on them in gate
This also run only functional tests for the functional tox testenv
Change-Id: Ibf1db3fe55f82dd6dc02f2e57d73608fcad80d0e
The rabbit driver have a custom code to reconnect to a broker,
to change the broker in HA configuration, to retry a to send
a message, to handle the interval between reconnection.
But all of that exists in kombu, so just use it.
Using the kombu Connection object with the url make also the rabbit
driver more generic.
Futher patches can rename rabbit* oslo.config options to a more generic
name and add a new driver entry_point 'kombu' to allow to use this driver
with any borker supported by kombu.
Change-Id: Id6b89d5448126ca652b46fe6ce5a9b3ed5839795