269 Commits

Author SHA1 Message Date
Mark McLoughlin
2937692464 Add release notes for 1.3.0a2
Change-Id: If4cf83d605801047053530ca5c7970e30132b4b0
2013-12-03 23:18:42 +00:00
Jenkins
fda06f6806 Merge "Remove useless global vars / import" 2013-12-03 13:34:30 +00:00
Julien Danjou
2b9bafd269 Simplify common base exception prototype
It seems there's no gain in trying to be smarter and different from the
base Python Exception, so let's remove our custom code to be more
compatible and friendly with all Python versions.

Change-Id: I259783ef1f77c6661ea7dc2325605c8d6290b898
2013-12-03 11:23:17 +01:00
Julien Danjou
97b9deca88 Remove useless global vars / import
This removes a few import and global variables that are not used through
the code. That cleans things a little.

Change-Id: I7b30bb11e8ad3c2df01ca2107eff2444feed3fe2
2013-12-02 15:26:53 +01:00
Jenkins
86b0750f3e Merge "Avoid storing configuration in notifier" 2013-11-29 20:58:14 +00:00
Julien Danjou
41c629dc03 Avoid storing configuration in notifier
The notifier itself doesn't use the configuration. So let's not store
it, that lights the dependency a bit on this configuration object.

Blueprint: messaging-decouple-cfg

Change-Id: Ic4b5ddd93ea0382bd8292f9e31b7dacba9b489d3
2013-11-29 17:51:41 +01:00
Julien Danjou
f9ab2e105f Implement a log handler using notifier
Change-Id: Iccac043d46a733e965b3310bbbe9c7d6c07a46ac
Blueprint: logging-and-notification
2013-11-29 16:15:09 +01:00
Julien Danjou
010163d8ee notifier: add audit level
This maps what is provided by the openstack.common.logging module.

Change-Id: Id581c4c748e2763a2c9a3e576e3bd497595adbff
2013-11-29 14:47:03 +01:00
Julien Danjou
5912b58233 Add 'warning' as an alias to 'warn'
The standard Python logging system uses 'warning' and not 'warn'. To
ease compatibility with it, let's add 'warning' too.

Change-Id: I7778d7960ca7a72be007cb083e5434ede6e3fe6e
2013-11-27 10:39:19 +01:00
Jenkins
f137822ab0 Merge "Supply missing argument to raise_invalid_topology_version()" 2013-11-26 21:50:22 +00:00
Chang Bo Guo
c98d7edef8 Decouple from Oslo uuidutils module
uuidutils module will be deprecated in Icehouse, So need replace it.
This patch uses str(uuid.uuid4()) instead of method generate_uuid.

Closes-Bug: #1253497
Change-Id: I35815544429c489096b4db3fa79a649f4cd9459f
2013-11-22 19:59:03 -08:00
Kenneth Giusti
9ea06bac57 Supply missing argument to raise_invalid_topology_version()
Change-Id: I110255fd426e61840989a520a8f3708dc4d9b8ab
2013-11-15 15:29:19 -05:00
Russell Bryant
7e1fddb217 Support a new qpid topology
There has been a bug open for a while pointing out that the way we
create direct exchanges with qpid results in leaking exchanges since
qpid doesn't support auto-deleting exchanges.  This was somewhat
mitigated by change to use a single reply queue.  This meant we created
far fewer direct exchanges, but the problem persists anyway.

A Qpid expert, William Henry, originally proposed a change to address
this issue.  Unfortunately, it wasn't backwards compatible with existing
installations.  This patch takes the same approach, but makes it
optional and off by default.  This will allow a migration period.

As a really nice side effect, the Qpid experts have told us that this
change will also allow us to use Qpid broker federation to provide HA.

DocImpact
Closes-bug: #1178375
Co-authored-by: William Henry <whenry@redhat.com>
Change-Id: I09b8317c0d8a298237beeb3105f2b90cb13933d8
2013-11-15 14:05:37 -05:00
Jenkins
2414524c6e Merge "Remove hosts as property in TransportURL" 2013-11-14 14:47:45 +00:00
Jenkins
6490ad672e Merge "Remove property on virtual_host in TransportURL" 2013-11-14 14:46:44 +00:00
Julien Danjou
2545a5d806 Remove hosts as property in TransportURL
There's no need to use this indirection there.

Change-Id: Ia0d247693509f14b1a0a2faffb7da8884c679170
2013-11-12 18:22:10 +01:00
Julien Danjou
c65bfb7a55 Remove property on virtual_host in TransportURL
This isn't useful at all.

Change-Id: I1025da66a0f382cc3ecec15acf01890d75257a6a
2013-11-12 18:22:06 +01:00
OpenStack Jenkins
0d54ae4a2f Updated from global requirements
Change-Id: I9d453b1270f82821273b1cc654e031599c1f9f77
2013-11-11 18:49:45 +00:00
Chang Bo Guo
0b078b6062 Fix some typos and adjust capitalization
Change-Id: I61cf108f9746fc44a08d83e11d44ed1007a6a1fa
2013-11-03 07:07:51 -08:00
Christian Strack
b29a1462c2 Changes driver method for notifications
Oslo.messaging.Transport is used as an abstraction to redirect function
calls to the configured driver. _send_notification called
self._driver.send instead of self._driver.send_notification

As the test
oslo.messaging.tests.TestTransportMethodArgs.test_send_notification also
assumed that send was the correct method, this should be changed
accordingly

Change-Id: I9406d74f3dc13c44d1aaad5379aafbf1a8580137
2013-10-31 15:08:06 +01:00
Mark McLoughlin
7914181398 Properly handle transport URL config on the client
On the client side, in the rabbit and qpid drivers, we use a connection
pool to avoid opening a connection for each message we send. However,
there is only currently one connection pool per process:

 def get_connection_pool(conf, connection_cls):
     with _pool_create_sem:
         # Make sure only one thread tries to create the connection pool.
         if not connection_cls.pool:
             connection_cls.pool = ConnectionPool(conf, connection_cls)
     return connection_cls.pool

This is a nasty artifact of the original RPC having no conectp of a
transport context - everything was a global. We'll fix this soon enough.

In the meantime, we need to make sure we only use this connection pool
where we're not using the default transport configuration from the
config file - i.e. where we supply a transport URL.

The use case here is cells - we send messages to a remote cell by
connecting to it using a transport URL. In our devstack testing, the
two cells are on the same Rabbit broker but under different virtual
hosts. Because we were always using the connection pool on the client
side, we were seeing both cells always send messages to the '/' virtual
host.

Note - avoiding the connection pool in the case of cells is the same
behaviour as the current RPC code:

 def cast_to_server(conf, context, server_params, topic, msg, connection_pool):
     ...
     with ConnectionContext(conf, connection_pool, pooled=False,
                            server_params=server_params) as conn:

Change-Id: I2f35b45ef237bb85ab8faf58a408c03fcb1de9d7
2013-10-25 07:18:36 +01:00
OpenStack Jenkins
9853fc6ac5 Updated from global requirements
Change-Id: I8275dd8bfd72d3a71d9606f8822a778023c1f0b9
2013-10-24 13:17:27 +00:00
Jenkins
18a11da1dc Merge "Properly handle transport:///vhost URL" 2013-10-24 01:14:51 +00:00
Jenkins
189c206b4a Merge "Replace assertEquals with assertEqual" 2013-10-23 19:50:26 +00:00
OpenStack Jenkins
1dc1709669 Updated from global requirements
Change-Id: I7080ecd84738030e9143f6b313522e2e5ebf6540
2013-10-23 14:37:20 +00:00
Zhongyue Luo
c59e04fbfa Replace assertEquals with assertEqual
The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals.

Change-Id: Iba0ae72e72470cdf5b122defcd68effc5434f948
2013-10-23 16:23:01 +08:00
Mark McLoughlin
2ec1fb7572 Properly handle transport:///vhost URL
Currently, if we are supplied with a transport URL with only the virtual
host specified, we completely ignore it. Instead, the behaviour should
be that we use that virtual host with the host, port and credentials
from the config file.

Change-Id: Ic97aa511ddf9bce69b1a5069d9f6468f4bd6dd4c
2013-10-23 07:45:16 +01:00
Jenkins
0b8f688efd Merge "Make rpc_backend default to 'rabbit'" 2013-10-21 17:16:30 +00:00
OpenStack Jenkins
b2cef24603 Updated from global requirements
Change-Id: I076e205d326c8da4e72032d81e46be21cba8ebe5
2013-10-20 00:00:50 +00:00
Mark McLoughlin
3a2a4d9831 Make rpc_backend default to 'rabbit'
'rabbit' is the canonical name for the driver and 'kombu' is just an
alias, so let's set the default to the canonical.

Change-Id: If163ece6793d2a7d6e99d0c8df1745bbcf9a36e6
2013-10-18 14:54:26 +01:00
Jenkins
14310fa45f Merge "Add third element to RPC versions for backports" 2013-10-15 11:41:57 +00:00
Davanum Srinivas
5f760096d6 Apply six for metaclass
__metaclass__ cannot be used in python3.six be used in general
for python 3 compatibility.

Porting Change-Id I9fc7a59df3af29b4cc1287c40fa4e883d994a961
from oslo-incubator

Change-Id: Icdacdcf5556b6d3b8450d1350c6f62b4f5a9690b
2013-10-14 14:10:31 -04:00
Davanum Srinivas
5af4478fb2 Add third element to RPC versions for backports
This makes the RPC version support three elements, adding a "revision"
in addition to the major and minor version. The revision would always
be zero for the master branch of a service, but could be incremented
for stable versions. This provides us some room to backport fixes
that affect RPC versions in such a way that would avoid breaking
the version lineage for systems running stable versions that may
some day be involved in a rolling upgrade to a version from master.

I didn't find any tests for version_is_compatible(), so I added
some for existing version scenarios, as well as new ones with
revisions. They also serve to validate that this doesn't break
anything for code using two-element versions (the expectation is that
two-element versions will still be used everywhere until a third
is needed).

Porting chages from Change-Id I239c17a3e305f572493498c4b96ee3c7514c5881
to oslo-incubator

Change-Id: I4fa7b0be14a7afba36136a746b76036355f119b2
2013-10-14 11:24:57 +00:00
Mark McLoughlin
91f74d8df0 Fix rpc client docs
Missing a colon before the example code, see:

  http://docs.openstack.org/developer/oslo.messaging/rpcclient.html

Change-Id: Icd875e509b0057c2c739d43c11cd37ab923b59ee
2013-10-13 08:13:43 +01:00
OpenStack Jenkins
f0ad97b344 Updated from global requirements
Change-Id: I4f26d3a8790c799e5c1f7f81031406e0c57545f9

Change-Id: Ica7315effe308bd739e90f885849fac27a3c542b
2013-10-10 20:26:31 +00:00
Monty Taylor
a1b57a5452 Remove cruft from setup.cfg
packages is recursive, so there is no need to list subpackages
versions are set by tags, so the version in the file is not needed
non-d2to1-based pbr does not need the hook specification

Change-Id: Id5e6c19dfe81c630862e9b87b7f9e5f67a965945
2013-10-04 10:07:58 -04:00
OpenStack Jenkins
2aa1dc6ca3 Updated from global requirements
Change-Id: I81e3d4bf4eef833b0b55d17e2a55028972ea4b55
2013-10-01 16:14:29 +00:00
Kenneth Giusti
86f2e74e13 Fixes a typo in the address string syntax
Closes-Bug: #1211338
Change-Id: I49ffc4f70cfa54a03c47537c16c35646d38f84c6
2013-09-18 13:11:51 -05:00
Mark McLoughlin
b6d8087746 Implement the server side of ZmqDriver
This implements the server side of the driver without modifying the
existing code by allowing the driver to spawn off multiple greenthreads
as before, but queueing any dispatched messages so that the executor
can still do listener.poll() to dispatch messages itself.

This is a hack, but it's a starting point.

Change-Id: Ie299c2695d81d0473cea81d40114326b89de0011
2013-08-28 14:06:36 +01:00
Mark McLoughlin
a2d113198c Add zmq-receiver
This is the ZeroMQ server which acts as a proxy for all messages
destined to a particular host. Again, there are a bunch of FIXMEs
here. This still needs work.

Change-Id: I9384f486e44b0b0cbca028e219ad66f1990d5181
2013-08-28 12:25:10 +01:00
Mark McLoughlin
5d3fc9c18c Implement the client side of ZmqDriver
Get sending working with an initial version of the driver. There's a
bunch of FIXMEs inline reflecting that even the client side needs a
tonne of work yet.

Change-Id: I6d69ebc9ae3b3999832209e0c4100ffe26e35919
2013-08-28 12:08:18 +01:00
Mark McLoughlin
ff3a4155bf Import zmq driver code with minimal modifications
Modifications are:

  - use stdlib logging; no huge need for oslo logging here

  - stub out the _() function; we don't have any l10n infrastructure in
    the project and may never have

  - change imports to oslo.messaging.openstack.common and
    oslo.messaging._drivers as appropriate

Change-Id: I87b85b79a33dec65e51ed95fff90cc56042240c5
2013-08-28 09:44:59 +01:00
Jenkins
868c085c83 Merge "Remove check_for_lock support in RPCClient" 2013-08-26 13:17:49 +00:00
Jenkins
5c2c32010c Merge "Don't include msg_id or reply_q in casts" 2013-08-26 13:16:42 +00:00
Jenkins
fd98ebadbb Merge "Fix race-condition in rabbit reply processing" 2013-08-26 13:16:06 +00:00
Mark McLoughlin
aebe53f242 Fix race-condition in rabbit reply processing
Concurrency. Sigh.

A sequence of events like this is possible:

  - We send a request from thread A
  - Thread B, who is waiting for a response gets scheduled
  - Thread B receives our response and queues it up
  - Thread B receives its own response and drops the connection lock
  - Thread A grabs the connection lock and wait for a response to arrive

The obvious solution is that when we grab the connection lock, we should
check whether a previous lock-holding thread had already received our
response and queued it up.

Change-Id: I88b0d55d5a40814a84d82ed4f42d5ba85d2ef7e0
2013-08-26 12:47:04 +01:00
Mark McLoughlin
59299dc202 Fix error message if message handler fails
There are a number of situations in which we log a message if an
exception occurs during the handling of a message:

  1) Something goes wrong pulling the message from the queue and
     de-serializing it - here we print "Failed to process message"

  2) An RPC endpoint method raises an expected exception - here we
     print an 'Expected exception during message handling' debug
     message

  3) An RPC endpoint method raises any other exception - here we
     should print an 'Exception during message handling' error message

However, in the latter case, we are currently printing out the 'Failed
to process' error message.

Change-Id: I4f7042b8ec978aaff8f4e20e62ba1ac765fe6ba5
2013-08-26 10:38:35 +01:00
Mark McLoughlin
f7cf85333c Don't include msg_id or reply_q in casts
On the server side, we only send replies if the request included a
_msg_id key. Also, the _reply_q key is only used when we wish to send a
reply.

So, in order to retain the exact same on-the-wire behaviour and ensure
servers aren't sending replies where none is needed, only include these
keys if we're doing a call (i.e. wait_for_reply=True).

Change-Id: Iac329493252be7d94b1ebe24f00e4d3f5c61d269
2013-08-26 10:23:06 +01:00
Mark McLoughlin
1806c0724a Remove check_for_lock support in RPCClient
I added check_for_lock because I assumed it was enabled by default and
actively in use by Nova. However, it actually isn't used by Nova yet and
enabling spews a tonne of warnings.

It's a rather clunky API and there's a good chance we can design a
better API for it, so let's leave it out until we're ready to actually
start using it in Nova.

Related-Bug: #1063222
Change-Id: Ib890978398059f360cd0f3352f4755262b8111c6
2013-08-26 09:31:12 +01:00
Mark McLoughlin
361092a488 Add a Notifier.prepare() method
Nova sends notifications with a bunch of different publisher_ids, so we
instantiate quite a lot of Notifier objects. Loading the noification
drivers for each of these is a substantial amount of overhead.

One obvious answer would be to make publisher_id an argument to the
error(), info(), etc. methods, but I think it's nice to encapsulate the
publisher_id in a notifier instance.

Instead, add a prepare() method which mirrors the approach in RPCClient.
You use this method to create a specialized notifier instance with a new
publisher_id.

Change-Id: Ia45fda3164086bb7a9ef6dee0587f726ab8b1a97
2013-08-21 07:30:49 +01:00