685 Commits

Author SHA1 Message Date
Mehdi Abaakouk
f3370da11a Don't share connection pool between driver object
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
2014-12-02 08:26:17 +01:00
Jenkins
f2234d291f Merge "Show what the threshold is being increased to" 2014-12-02 07:05:38 +00:00
Joshua Harlow
c7d99bf28f Show what the threshold is being increased to
Change-Id: I2182ca88126d636970885fe4403779a879f32aa7
2014-12-01 21:14:23 -08:00
Jenkins
ba8c8d4665 Merge "Wait for expected messages in listener pool test" 2014-12-01 13:11:25 +00:00
Jenkins
5ff5d335e4 Merge "Always use a poll timeout in the executor" 2014-12-01 13:11:18 +00:00
Mehdi Abaakouk
30a5b12eb4 Wait for expected messages in listener pool test
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
2014-11-29 10:04:48 +01:00
Jenkins
f58d03e0de Merge "Set correctly the messaging driver to use in tests" 2014-11-28 17:42:14 +00:00
Jenkins
87a82496a4 Merge "Reduces the unit tests run times" 2014-11-28 17:32:12 +00:00
Mehdi Abaakouk
c8e02e989d Dispath messages in all listeners in a pool
This change ensures that we have messages in each listener of
a pool.

Change-Id: I2bbb830760b7f9c271e6cebe2e3852e2a5a19722
Closes-bug: #1397338
2014-11-28 16:59:07 +01:00
Mehdi Abaakouk
cb96666135 Reduces the unit tests run times
This change reduces all rabbit delay related to retring calls.

Change-Id: Ie50f1a66aefde40d85c194729007182d4f6f6e0c
2014-11-28 15:15:58 +01:00
Mehdi Abaakouk
b369826e42 Set correctly the messaging driver to use in tests
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
2014-11-28 15:00:05 +01:00
Jenkins
bd56131b58 Merge "Remove the use of PROTOCOL_SSLv3" 2014-11-28 08:09:13 +00:00
Mehdi Abaakouk
7bce31a2d1 Always use a poll timeout in the executor
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
2014-11-28 08:39:28 +01:00
Jenkins
b631f46c7f Merge "Renamed PublishErrorsHandler" 2014-11-27 22:03:54 +00:00
Ilya Pekelny
e15cd36cd5 Renamed PublishErrorsHandler
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
2014-11-27 16:04:07 +02:00
Jenkins
590896caeb Merge "Add qpid and amqp 1.0 tox targets" 2014-11-27 12:34:44 +00:00
Jenkins
6e4ccfa60c Merge "Create a new connection when a process fork has been detected" 2014-11-27 12:34:36 +00:00
Jenkins
0b839c57b7 Merge "Notification listener pools" 2014-11-27 11:56:42 +00:00
Kenneth Giusti
80e62aed7d Create a new connection when a process fork has been detected
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
2014-11-26 21:24:54 -05:00
Thomas Goirand
42f55a1dda Remove the use of PROTOCOL_SSLv3
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
2014-11-25 10:47:16 -06:00
Jenkins
0650bde775 Merge "Documentation anomaly in TransportURL parse classmethod" 2014-11-21 13:36:26 +00:00
Jenkins
e67e9a6aa9 Merge "rabbit: uses kombu instead of builtin stuffs" 2014-11-20 23:19:33 +00:00
Mehdi Abaakouk
a8d3da228c Add qpid and amqp 1.0 tox targets
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
2014-11-20 15:11:24 +00:00
OpenStack Proposal Bot
a5ffc62dc8 Updated from global requirements
Change-Id: Ic229d9afdaf01abeff54d1087c21c70b25dcb0dd
2014-11-20 14:11:29 +00:00
Jenkins
b4a1e02691 Merge "Imported Translations from Transifex" 2014-11-20 12:10:14 +00:00
Jenkins
bc237be16e Merge "Remove unuseful param of the ConnectionContext" 2014-11-20 11:53:10 +00:00
OpenStack Proposal Bot
ee6a729644 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: If7c3172f74f4fede4d2b900d73a396c0834b0fc9
2014-11-20 06:11:41 +00:00
Jenkins
437915b3db Merge "Add basic tests for 0mq matchmakers" 2014-11-19 18:34:58 +00:00
Jenkins
1a53d3ed30 Merge "Enable user authentication in the AMQP 1.0 driver" 2014-11-19 16:34:00 +00:00
Mehdi Abaakouk
973301aa70 rabbit: uses kombu instead of builtin stuffs
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
2014-11-19 17:21:02 +01:00
Jenkins
c81880365a Merge "Create ZeroMQ Context per socket" 2014-11-19 14:17:08 +00:00
Jenkins
d9b919ff67 Merge "Allows to overriding oslotest environ var" 2014-11-19 13:26:58 +00:00
Mehdi Abaakouk
d9d04fb74b Allows to overriding oslotest environ var
This patch allows to override the oslotest environ variables
in the testr configuration

Change-Id: Ifec93f20446038f0af2ee9bae62b2aa6e97194a5
2014-11-19 11:28:02 +01:00
Elena Ezhova
0d49793e34 Create ZeroMQ Context per socket
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
2014-11-18 18:18:07 +03:00
Mehdi Abaakouk
7306680bfa Remove unuseful param of the ConnectionContext
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
2014-11-18 13:58:33 +01:00
OpenStack Proposal Bot
442d8b9e77 Updated from global requirements
Change-Id: I9d04f270038ba647a4a0ad849270aca2ea879874
2014-11-18 11:36:17 +00:00
James Page
5aadc56b66 Add basic tests for 0mq matchmakers
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
2014-11-17 21:34:29 -06:00
Mehdi Abaakouk
30e0aea877 Notification listener pools
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
2014-11-14 10:20:18 +01:00
Jenkins
6eb0d2ff80 Merge "Updated from global requirements" 2014-11-14 00:47:18 +00:00
Jenkins
33870feb41 Merge "Activate pep8 check that _ is imported" 2014-11-13 23:50:14 +00:00
OpenStack Proposal Bot
7ea4147b17 Updated from global requirements
Change-Id: I6c7256a412154915603bea4541383bf6fe3bfc5c
2014-11-13 22:34:20 +00:00
Clint Byrum
37e5e2a888 Fix tiny typo in server.py
Missing the word 'to'

Change-Id: I6d1cc923b4085f0451a3a4b2d4b716b2c7ac5e96
2014-11-13 10:44:45 -08:00
Julien Danjou
10eb1202b3 Switch to oslo.middleware
Change-Id: I35f76724768c163b57728914f0ed700f1bc13e29
2014-11-08 18:08:37 +01:00
OpenStack Proposal Bot
a3ca0e5d70 Updated from global requirements
Change-Id: I19c88980d8f12d9725a80e05cbb5418470e6bf37
2014-11-05 08:34:59 +00:00
James Carey
6f76039fa2 Activate pep8 check that _ is imported
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
2014-10-31 20:29:28 +00:00
Jenkins
c7211d125c Merge "zmq: Remove dead code" 2014-10-31 19:20:15 +00:00
Kenneth Giusti
f43fe66be0 Enable user authentication in the AMQP 1.0 driver
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
2014-10-31 11:46:24 -04:00
Oleksii Zamiatin
f74014a7db Documentation anomaly in TransportURL parse classmethod
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
2014-10-31 12:14:17 +02:00
Jenkins
6dc19e0b93 Merge "Add driver independent functional tests" 2014-10-29 09:44:29 +00:00
Jenkins
604407d6ab Merge "Don't put the message payload into warning log" 2014-10-28 20:59:10 +00:00