399 Commits

Author SHA1 Message Date
ChangBo Guo(gcb)
af72ad9a92 Refactor AMQP message broker selection
Drop redundant variable, make code more clean.

Partial-Bug: #1261631

Change-Id: I5fd71ce3bcd3a82839204ee1fb130de3a3e1d3ac
2014-03-22 15:47:59 +08:00
Ihar Hrachyshka
27e4a0da8b Add unit test to check the order of Qpid hosts on reconnect
Change-Id: I32e20c0e747e6489dab4b0358d422b8a9c6b982e
Partial-Bug: 1261631
2014-03-22 15:45:39 +08:00
Doug Hellmann
57ebe0d83d Clean up for qpid tests
Use the config object in the base class, and define a local
base class for managing connections instead of repeating
that code in several places.

Change-Id: I7816a467da449ba172dbaa23e58b511adc1ba40a
2014-03-19 13:25:48 +01:00
Jenkins
66bb4f3cc6 Merge "Remove vim header" 2014-03-19 05:08:58 +00:00
Jenkins
2c4e79f816 Merge "Build log_handler documentation" 2014-03-19 00:57:43 +00:00
Jenkins
bf20f74ca2 Merge "Add kombu driver library to requirements.txt" 2014-03-18 19:18:07 +00:00
Clint Byrum
52bc704b6e Add kombu driver library to requirements.txt
The RabbitMQ driver is the default driver for oslo.messaging, so it
makes some sense to require this by default. This is consistent with
the way e.g. Nova has always required kombu.

Change-Id: Ibcab58e3f3edce794b571cfabc0a5bcf96c9b47e
Closes-Bug: #1288425
2014-03-18 11:52:47 +00:00
ChangBo Guo(gcb)
16a4c9ea7a Remove vim header
We don't need vim modelines in each source file, it can be set in
user's vimrc.

Change-Id: I615f1ffc7e097f1ddbd908a512f1cb988489e871
Closes-Bug: #1229324
2014-03-18 05:51:12 +00:00
OpenStack Jenkins
2d0cfec5b7 Updated from global requirements
Change-Id: I30e46e95cbfc3024b1a1ab0de8bd79bf9e80d322
2014-03-11 17:35:25 +00:00
Jenkins
5f5501f534 Merge "notify listener: document the metadata callback parameter" 2014-03-10 14:27:32 +00:00
Alex Holden
b75a9d4378 Fixed spelling error - runnung to running
Change-Id: I20428f7cb3da449239d8321b1dc1b3f60570ed05
2014-03-07 09:33:53 -08:00
Lance Bragstad
5985a8c717 Build log_handler documentation
When log_handler.py was added to oslo.messaging changes weren't made to
publish the documentation. This patch ensures the docs for log_handler
are built.

Change-Id: Ibf60f648ad07875fb4c61427e601b6b268a95f53
Closes-Bug: 1286984
2014-03-06 02:17:36 +00:00
Jenkins
33ef68c530 Merge "Adds unit test cases to impl_qpid" 2014-03-06 02:06:28 +00:00
Jenkins
048c8c3e60 Merge "Expose PublishErrorsHandler through oslo.messaging" 2014-03-06 02:06:28 +00:00
Jenkins
543d5f06bb Merge "Remove use of sslutils" 2014-03-04 18:42:48 +00:00
Mark McLoughlin
3eeaaee788 Remove use of sslutils
sslutils is the only oslo-incubator module we use which registers any
config options, and we don't even use those config options at runtime.

The problem with us using oslo-incubator config options is that they
need to be exactly in sync with the oslo-incubator version of those
used by every project using oslo.messaging.

Avoid all this be inlining validate_ssl_version() until we have it
available in a real library.

Change-Id: Id3b0bb2e7ede33ede9b66025d1af113ae60cfc58
Closes-Bug: #1287542
2014-03-04 06:23:35 -08:00
Jenkins
68ee02535b Merge "Don't run python 3 tests by default" 2014-03-04 04:56:21 +00:00
Jenkins
491414408b Merge "Slow down Kombu reconnect attempts" 2014-03-04 04:33:25 +00:00
Jenkins
5594a57012 Merge "Gracefully handle consumer cancel notifications" 2014-03-04 04:33:24 +00:00
Jenkins
693d6780e7 Merge "Do not leak _unique_id out of amqp drivers" 2014-03-04 00:56:59 +00:00
Doug Hellmann
7a6f5054fd Expose PublishErrorsHandler through oslo.messaging
Fix up the imports so that the log handler for publishing
error messages is available through the oslo.messaging
package instead of users having to know the full path
inside the sub-module.

Change-Id: I5c8ddaf451f7c977d8c400fe920512cdafbc7fdf
2014-03-03 15:21:28 -08:00
Jenkins
8cccf06c65 Merge "notification listener: add allow_requeue param" 2014-03-03 20:49:54 +00:00
Mark McLoughlin
8060878b5b notify listener: document the metadata callback parameter
Add some details about what the metadata parameter contains.

Change-Id: I191c1c480c679534c1dede9aa85c51615faf0800
2014-03-03 09:43:21 -08:00
Mehdi Abaakouk
ed2a1545c0 Add missing data into the notif. endpoint callback
Some information about the notification (ie: message_id and timestamp)
are currently not available for the application.

This change add them.

Partial implements blueprint notification-subscriber-server

Change-Id: I83e562725205fb270f6065fe1118c3c9865b2294
2014-03-03 17:33:41 +01:00
Mark McLoughlin
5bd31315c2 notification listener: add allow_requeue param
In commit d8d2ad9 we added support for notification listener endpoint
methods to return REQUEUE, but if a driver does not support this we
raise NotImplementedError when the application attempts to requeue
a message.

This requeuing behaviour might only be used by an application in
unusual, exceptional circumstances and catch users by surprise.

Instead, let's require the application to assert that it needs this
feature in advance and raise NotImplementError at that point if the
driver doesn't support it.

Change-Id: Id0bb0e57d2dcc1ec7d752e98c9b1e8e48d99f35c
2014-03-03 07:51:18 -08:00
Numan Siddique
c872f8d670 Adds unit test cases to impl_qpid
Change-Id: I0c056efd9fb8b48d02a11dfb969ee98b736ba017
Closes-Bug: #1255239
2014-03-03 21:01:32 +05:30
Mark McLoughlin
5464229e63 Do not leak _unique_id out of amqp drivers
In commit d8d2ad9 we delayed when a message's unique ID gets added to
the duplicate message cache in order to allow for message requeueing.

However, as part of this, we exposed the private _unique_id field
outside of the driver. This commit reverses that change by storing
the ID in the AMQPIncomingMessage object.

Change-Id: Ibeb7896de7ad9abf3c6a43495c1a87aabb762c0d
2014-03-03 07:18:54 -08:00
Mehdi Abaakouk
71ac681a73 Add multiple exchange per listerner in fake driver
This patch allow the FakeListener to listen on multiple FakeExchange.

Partial implements blueprint notification-subscriber-server

Change-Id: I9830cc01efdd931f6628853f7e84b947d7b855c9
2014-03-03 09:27:57 +01:00
Mehdi Abaakouk
d8d2ad95d7 Allow to requeue the notification message
This patch allow to requeue the notification received by the
notification listener.

Partial implements blueprint notification-subscriber-server

Change-Id: I49c4ba91224c280e479edb19289ccb337a2ab843
2014-03-03 09:27:57 +01:00
Nicolas Simonds
fcd51a67d1 Slow down Kombu reconnect attempts
For a rationale for this patch, see the discussion surrounding Bug

When reconnecting to a RabbitMQ cluster with mirrored queues in
use, the attempt to release the connection can hang "indefinitely"
somewhere deep down in Kombu.  Blocking the thread for a bit
prior to release seems to kludge around the problem where it is
otherwise reproduceable.

DocImpact

Change-Id: Ic2ede3046709b831adf8204e4c909c589c1786c4
Partial-Bug: 856764
2014-02-28 14:37:51 -08:00
Doug Hellmann
0f1aeee7b2 Don't run python 3 tests by default
Remove py33 from the list of environments used when someone
runs "tox" without any arguments. The python 3.3 tests do
not pass yet, and the expected failure is confusing to new
contributors.

Change-Id: I1f1307153c4a32e59bcffbf340c31dbf3e70173c
2014-02-28 14:23:55 -08:00
Chet Burgess
0400cbf4f8 Gracefully handle consumer cancel notifications
With mirrored queues and clustered rabbit nodes a queue is still
mastered by a single rabbit node. When the rabbit node dies an
election occurs amongst the remaining nodes and a new master is
elected. When a slave is promoted to master it will close all the
open channels to its consumers but it will not close the
connections. This is reported to consumers as a consumer cancel
notification (CCN). Consumers need to re-subscribe to these queues
when they recieve a CCN.

kombu 2.1.4+ reports CCNs as channel errors. This patch updates
the ensure function to be more inline with the upstream kombu
functionality. We now monitor for channel errors as well as
connection errors and initiate a reconnect if we detect an error.

Change-Id: Ie00f67e65250dc983fa45877c14091ad4ae136b4
Partial-Bug: 856764
2014-02-28 14:22:26 -08:00
OpenStack Jenkins
35f6d588a3 Updated from global requirements
Change-Id: Iddf9be2b384f9c0871a2baf59e94ec5201ca37c6
2014-02-28 08:00:27 +00:00
Jeremy Hanmer
fb453e4f08 Convert to oslo.test
bp graduate-oslo-test

Change-Id: Iff1eebac011dab26468a7f1475b5c36b0bb2a7d2
2014-02-26 17:06:03 -08:00
Jenkins
7564e2cf47 Merge "User a more accurate max_delay for reconnects" 2014-02-26 02:14:30 +00:00
Jenkins
9bf03ad506 Merge "Add a link to the docs from the README" 2014-02-25 17:17:20 +00:00
Jenkins
14e3aeb3da Merge "Add log_handler to oslo.messaging" 2014-02-25 16:51:54 +00:00
Jenkins
e9821fe602 Merge "Improve help strings" 2014-02-25 12:40:18 +00:00
Lance Bragstad
78ff56e170 Add log_handler to oslo.messaging
Move log_handler from oslo-incubator to oslo.messaging and include
unit tests. This patch also adds an additional test case from the
original version in oslo-incubator. Originally, the test case only
checked to make sure the notification was not sent. Now a positive test
case exists to test both paths.

bp graduate-notifier-log-handler
Co-Authored By: Ben Nemec <bnemec@redhat.com>

Change-Id: I9ea051ec7e3614579341a31d8dc1c13d9514b8a9
2014-02-21 22:41:37 +00:00
kgriffs
5f2d8330b4 Add a link to the docs from the README
Newcomers often struggle to find the docs for Oslo libraries. Let's
help them out a little.

Change-Id: I68cb214ad117ff1c45e83df302f37dba485147f6
2014-02-19 14:07:58 -06:00
Xavier Queralt
8a3744fe05 Pass the session to QpidMessage constructor
The patch in I6e37780cc28737cfd56b6719ec8d9cebbc9bb278 added a new class
for the QpidMessage which was wrongly initialized when processing a
message.

Change-Id: Iaf525fc6ee9e56100c89863f9c651f20c148ecb5
Closes-Bug: 1282038
2014-02-19 12:15:29 +01:00
Flavio Percoco
dc1f984dac User a more accurate max_delay for reconnects
In an HA deployment, a 60 seconds delay between reconnects can be quite
problematic. This patch changes the delay calculation by setting the max
delay to 5s and by changing the way it is increased.

Unfortunately, this is one of the places where both our main drivers are
not consistent. Rabbit's driver uses configuration parameters for this
whereas qpid's driver has never had one. However, I would prefer not
adding configuration paremeters to qpid's driver for the following
reasons:

    1. Most of OpenStack services depend on the messaging layer, hence
    they need it to be available. A 5s delay seems to be reasonable and
    I could argue the need of tune it further. Although so frequent
    reconnects can add load to the network, that wouldn't be the main
    issue if one of the brokers go down.
    2. We're trying to move away from configuration options towards using
    transport URL. This path is still not clear and I would
    prefer avoiding adding new options until we clear it out.

Change-Id: I537015f452eb770acba41fdedfe221628f52a920
Closes-bug: #1281148
2014-02-18 10:56:21 +01:00
Mehdi Abaakouk
e785a5d994 Make the dispatcher responsible of the message ack
This patch make the dispatcher responsible of the message
acknowledgement.

This is the preliminar step to be able to requeue message.

Partial implements blueprint notification-subscriber-server

Change-Id: If74b47d5e23976d407deb27df7395b1982963c75
2014-02-18 08:31:30 +01:00
Mehdi Abaakouk
8a644c1166 Don't reply to notification message
The notification listener doesn't have anything to send to the notifier
and the notifier doesn't attend to receive something.

So this patch remove the message reply when the listener is a
notification
listener.

Partial implements blueprint notification-subscriber-server

Change-Id: Ic989947ba3b6894cde788422842fca19159ea261
2014-02-18 08:31:30 +01:00
Jenkins
7473d18ebe Merge "Abstract the acknowledge layer of a message" 2014-02-17 16:39:24 +00:00
Jenkins
15bfa35e0c Merge "Implements notification listener and dispatcher" 2014-02-17 16:33:42 +00:00
Mehdi Abaakouk
0d102aa361 Abstract the acknowledge layer of a message
The patch add ta abstraction layer to acknowledge a message.

Partial implements blueprint notification-subscriber-server

Change-Id: I6e37780cc28737cfd56b6719ec8d9cebbc9bb278
2014-02-14 16:06:26 +01:00
Mehdi Abaakouk
9f58e2c3fe Implements notification listener and dispatcher
This patch allows to quickly create a listener to receive
notification messages.

Example of the api:

class Endpoint(object):
    def warn(self, ctxt, publisher_id, event_type, payload):
        do_something(payload)

target = messaging.Target(topic='notifications', exchange='cinder')
listener = notify.get_notification_listener(transport, [target],
                                            [Endpoint()],
                                            executor,
                                            serializer)

Implements blueprint notification-subscriber-server

Change-Id: I434bc487c382a2048670df726d9bebd640150bb9
2014-02-14 16:06:26 +01:00
Dirk Mueller
de6d92fb92 Switch over to oslosphinx
Having the sphinx theme in the same namespace package
as the production code has been causing issues with
devstack installations. The solution settled on was
to rename oslo.sphinx to oslosphinx because oslo.sphinx
is not a "production" library.

See the linked bug report for more background details.

Closes-Bug: #1277168
Change-Id: I220b8901cef36499e91b92719f1e8e5461a95e92
2014-02-14 10:09:13 +00:00
Jenkins
70dbe6a7cc Merge "Update ExpectedException handling" 2014-02-11 15:52:25 +00:00