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
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
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
ZeroMQ Context is a singleton and thus is created only once. This leads
to problems when there is more than one process working with it.
For example, while Neutron server starts, it firstly loads core
plugin and service plugins, which start message handling server,
and only then forks to create api-workers. As a result, all child
processes get the same copy of the context.
Creating new Context for each socket will prevent such situations
from happening and will guarantee that each process works with its
own Context.
Change-Id: I56912e39b119c20f6f23311fc2c7c4b9e9e480d0
Closes-Bug: #1364814
The ConnectionContext depends on the ConnectionPool.
A ConnectionPool already known the connection classes,
the configuration object and the url needed to create a new connection.
But we pass again thoses informations when we create a ConnectionContext.
This is unuseful, we can reuse thoses in the connection pool even we
want a not pooled connection.
This change removes the unuseful ConnectionContext parameters,
this also ensures that connection created with or without the pool
are created in the same ways and only at one place (the create method
of the connection pool).
Change-Id: I4bd43d202fa2774ad5dcb0f8dd05e58ba60c6009
Basic unit tests for in-memory (localhost), ring and Redis based
matchmakers.
Redis tests are opportunitic based on a redis-server being installed
and running.
Test are currently skipped under py3 due to direct dependency on
eventlet.
Co-Authored-By: Kapil Thangavelu <kapil.thangavelu@canonical.com>
Change-Id: I59c4d095033370ab94f645af0d50e2502530f816
Partial-bug: #1302941
We can now set the pool name of a notification listener
to create multiple groups/pools of listeners consuming notifications
and that each group/pool only receives one copy of each notification.
The AMQP implementation of that is to set queue_name with the pool name.
Implements blueprint notification-listener-pools
Closes-bug: #1356226
Change-Id: I8dc0549f5550f684a261c78c58737b798fcdd656
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: I077b9b2060e618823ef6dd6f95ce9fe7dcc52a06
The TransportHost class allows user credentials to be supplied as part
of the URL that identifies the host. Prior to this patch, these
credentials - username and password - were ignored by the AMQP 1.0
driver. This prevents connections to a message broker that has been
configured to use SASL PLAIN authentication.
Closes-Bug: #1385445
Change-Id: Ib9279ed40b0f4cff62e1c742069c8f49f5625659
The documentation for the classmethod `parse` states that
The last parsed username and password will be propagated to the rest
of hosts specified::
user:pass@host1:port1,host2:port2
[
{"username": "user", "password": "pass", "host": "host1:port1"},
{"username": "user", "password": "pass", "host": "host2:port2"}
]
However, in practice one needs to specify the usernames and passwords
individually with every host.
DocImpact: Documentation needs to be changed due anomaly in TransportURL
parse classmethod.
Change-Id: I1a9e07e0380a0d6f7d00731df93c9ba01ae20e0e
Closes-Bug: #1355684