1036 Commits

Author SHA1 Message Date
Oscar Huang
d5780ad357 Fix amqp connection pool leak in ConnectionContext
When failed in connection.reset(), the current code simply
discards the broken connection, without returning a new one
to the pool, nor adjust pool counter. It results in a connection
leak and eventually blocks the thread.

It is fixed by returning a new connection into the pool.

Change-Id: I2b2c23def718d8f2409f9fc415441ac88d40f5b9
Closes-Bug: #1474698
2015-07-15 10:29:24 +00:00
Jenkins
8a9b5d44ae Merge "Executor docstring & attribute tweaks" 2015-07-15 00:56:55 +00:00
Joshua Harlow
c5389bebce Executor docstring & attribute tweaks
Adjust some docstrings to better align with the class
they are attached to. Also changes some docstrings for
the pooled executor (as it is an abstraction on-top of
async executors, and is not tied to threads anymore) and
correctly denote this on its attributes that others can
and are overriding. 

Change-Id: I2eaaeed3aa0ae64eb5c82843381b7518ac508ac1
2015-07-14 15:43:04 +00:00
Jenkins
ead733a2dc Merge "Use the warn_eventlet_not_patched util function" 2015-07-14 10:40:56 +00:00
Joshua Harlow
4df24f7d1c Use the warn_eventlet_not_patched util function
This code can share the check for eventlet and warn
when the thread module is not patched (which will be
a problem).

When it is not patched the following warning gets
emitted:

"RuntimeWarning: It is highly recommended that when eventlet"
" is used that the ['thread'] modules are monkey patched when"
" using the 'oslo.messaging eventlet executor' (to avoid spurious"
" or unexpected lock-ups and/or hangs)"

This will not be needed once a new futurist release happens
but until then standardize on using that util library to emit
these warnings.

Change-Id: I7277fe19a73d8094a0acf033c75dc881e0d1e533
2015-07-13 16:32:38 -07:00
Doug Hellmann
857ccabc9c Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names. It also adds a local
hacking check to prevent regressions, while disabling style checks in
the "tests" directory, which will be deleted in a subsequent patch.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Iad2ae13c771c99861ca9493c6ab10edcfbd8684a
2015-07-13 21:12:35 +00:00
Jenkins
9eef14f1c0 Merge "Make heartbeat the default" 2015-07-13 11:04:14 +00:00
Jenkins
b48487e65b Merge "Don't reply when we known that client is gone" 2015-07-13 11:03:09 +00:00
Jenkins
0969bfcd89 Merge "Verify that version in 'prepare' is valid" 2015-07-13 11:01:24 +00:00
OpenStack Proposal Bot
f04a321076 Updated from global requirements
Change-Id: If67f874c1761018c8cd2fb138cef9f76a69f9934
2015-07-12 15:21:33 +00:00
Jenkins
2fe968c15d Merge "Updated from global requirements" 2015-07-11 04:29:56 +00:00
Jenkins
0055d79ac2 Merge "Remove usage of contentmanager for executors" 2015-07-11 03:19:49 +00:00
OpenStack Proposal Bot
6dda4a751f Updated from global requirements
Change-Id: If68c8e463dc6f2b8118bb66626b5a73d81053b5d
2015-07-10 20:43:19 +00:00
Doug Hellmann
c7b31385ac Fix mock use for mock 1.1.0
Correct the way we check the calls by using the proper mock method. Add
a new test to expand coverage of the area being fixed.

Change-Id: I344ee52dd0ea77bc45b6d3e2713ae1ba8b225ffc
2015-07-10 12:22:26 +00:00
Flavio Percoco
168f6cc2bb Make heartbeat the default
When heartbeat was introduced, it couldn't be enabled by default because
it depended on a minimum kombu version that we couldn't bump to at the
end of the release.

Now that Liberty is open and the minimum required version has been
bumped, I'm enabling heartbeat by default. The threshold this patch uses
is `60` which is the one gotten from tests and other deployments. Lets
make sure this is a sande default before merging the patch.

Change-Id: I21c29c328ef9936e76a215ab15962b46247dadd9
2015-07-09 16:05:17 -07:00
Jenkins
a5e707c2bc Merge "Imported Translations from Transifex" 2015-07-09 15:04:08 +00:00
Mehdi Abaakouk
79b308bc8c Use oslo.log in the zmq receiver
The zmq receiver must allow to be configurable like any other
openstack daemon.

Change-Id: I8db72239d6be04c25bef37a539b7c4ecd457225b
2015-07-09 14:55:25 +03:00
OpenStack Proposal Bot
483296e8d3 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I854c9b37cbce16903d6119f78b3e3a3123a19497
2015-07-09 06:22:36 +00:00
Mehdi Abaakouk
c49594a62f Remove usage of contentmanager for executors
The context manager in the executor fit only for the blocking executor.
Even the dispatcher needs to run code before and after the application
callback, eventlet and future executors have to run the pre/post code
into the main thread and can run the callback into an other thread,
and that force them to run __enter__ and __exit__ manually and deal
the exception path.

This change adds a helper object instead of the context manager.
It is designed to be explicit on what must be executed
before and after the callback and what can be done in a thread or not.

All the executor code is now in the impl_pooledexecutor.py
and use the futures "PoolExecutor" API.

This use futurist to provide a eventlet and aioeventlet futures friendly
object.

Change-Id: I8cd7640f36beeda47560e3c82671bad3530e38d1
2015-07-08 13:42:10 +02:00
Kevin Benton
ac57114c2d Verify that version in 'prepare' is valid
Raise an exception if a caller passes a something for the
version that cannot be parsed as a version.

Change-Id: I167849b1bc6c4d946de42c6459b3577a361e9606
Related-Bug: #1467087
2015-07-07 07:34:12 -07:00
Jenkins
3b891fcfcb Merge "Deprecated impl_qpid" 2015-07-06 17:06:35 +00:00
Jenkins
1d3c39a02e Merge "Imported Translations from Transifex" 2015-07-06 16:48:28 +00:00
Jenkins
456155e318 Merge "Remove py26 artefacts from oslo.messaging code" 2015-07-06 16:48:08 +00:00
Jenkins
c9ae87bb77 Merge "Remove 2.6 classifier" 2015-07-06 12:13:58 +00:00
Mehdi Abaakouk
286659a38b Don't reply when we known that client is gone
In case of a broker restart/failover a reply queue can be
unreachable for short period the IncomingMessage.send_reply
will block for 60 seconds in this case or until rabbit recovers.

But in case of the reply queue is unreachable because the
rpc client is really gone, we can have a ton of reply to send
waiting 60 seconds.
This leads to a starvation of connection of the pool
The rpc server take to much time to send reply, other rpc client will
raise TimeoutError because their don't receive their replies in time.

This changes introduces an object cache that stores already known gone
client to not wait 60 seconds and hold a connection of the pool
Keeping 200 last gone rpc client for 1 minute is enough
and doesn't hold to much memory.

This also don't raise anymore a frightening exception when we can't send reply
to the rpc client. But just logging a info about missing exchange and
a warning about unsend reply.

Closes-bug: #1460652

Change-Id: I928b30c9b5f9ee007532ff703e136640b0e8aaf4
2015-07-06 13:17:00 +03:00
Jenkins
952fd2d422 Merge "Add WebOb and greenlet to requirements" 2015-07-06 09:57:37 +00:00
Jenkins
d9d325082e Merge "Use ServiceBase from oslo.service as a parent class" 2015-07-06 09:11:02 +00:00
Victor Sergeyev
2734fc8f50 Remove py26 artefacts from oslo.messaging code
If we are not support py26 anymore, we can remove py26 tox environment
and some specific code.

Change-Id: I9b935c0bcbb4ddfd5388ad5ad76c6e7662c9f2fa
2015-07-06 12:04:02 +03:00
Joshua Harlow
7c2aa0ced0 Remove 2.6 classifier
This removes the 2.6 classifier so that support for 2.6
is not noted (when building packages, on pypi...) as happening
anymore for oslo.messaging (since check/gating support for
it has been turned off).

Depends-On: I4013bf38a197c9a9d82b3956ddbd25450d913df9

Change-Id: Ic4150332fff0724e5178e14f91ac54d5a80d408b
2015-07-06 12:02:54 +03:00
OpenStack Proposal Bot
6f63aa9ad7 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ia8f191905ce39b849a290862bafd92bbd7b23471
2015-07-06 06:13:34 +00:00
Davanum Srinivas
9ec11b727a Add WebOb and greenlet to requirements
Running "pip-missing-reqs" tox target showed these references
in our code. Since we refer to them directly, we should add
them to our requirements.

Depends-On: I0f07858e96ea3baf46f8a453e253b9ed29c7f7e2
Depends-On: I33bd2d9dff9cb7dc1a50177db7286b7317966784
Change-Id: Ie043415f217c0ca71702c41dbec835a2c26ef9cb
2015-07-04 03:59:39 +00:00
Jenkins
8dc5923a98 Merge "Add a missed raise statement" 2015-07-02 16:39:40 +00:00
Sergey Vilgelm
8aaa7c369b Use ServiceBase from oslo.service as a parent class
Inherit MessageHandlingServer from ServiceBase.
Add the dummy "reset" method to the MessageHandlingServer.

Closes-Bug: #1470484
Change-Id: I4159450f54609c5185146472179d4299fe0c9d30
2015-07-02 18:35:09 +03:00
Sergey Vilgelm
862aca7f32 Manual update the requirements
According to the disscussion[1] we have to remove the requirements-PYN.txt

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-July/068469.html

Change-Id: I9de07e595f6f75b91ef3f92fddcd95300b15e772
2015-07-02 16:51:42 +03:00
Flavio Percoco
10c39d5df4 Deprecated impl_qpid
As per discussions, this patch marks the qpid driver as deprecated. The
removal release has been set to M.

DocImpact
Change-Id: I81f667e0f440ae4e0a7226800a5f99809fc6dce2
2015-07-02 11:10:17 +00:00
Victor Sergeyev
de6d4f11af Add a missed raise statement
Change-Id: I8cec4aaae56dac32b98910f0a620020996ae2814
2015-07-02 13:57:27 +03:00
Flavio Percoco
c9021c2116 Remove qpid-config call
There's no need to install qpid-tools and run qpid-config for this case.
The check on the process output should be enough. This also removes
qpid-tools as a dependency for the qpid jobs.

Change-Id: Ie81a2630cb5d593729b18569cc82b83e9817f6ab
2015-07-01 11:46:34 +00:00
Jenkins
3e46c151a7 Merge "Add tox target to find missing requirements" 2015-06-30 19:27:59 +00:00
Jenkins
2ec7ed602f Merge "Correct RPCVersionCapError message" 2015-06-27 03:23:42 +00:00
Davanum Srinivas
f1c2b8ff91 Add tox target to find missing requirements
Change-Id: I49465a614540c6cc1a0e3f1b448f13db940c784c
2015-06-26 07:26:24 -04:00
Jenkins
9d08842715 Merge "Imported Translations from Transifex" 2015-06-26 10:57:31 +00:00
Flavio Percoco
079c04f0d0 Fix qpid's functional gate
The loggin verbosity changed in 0.32 which our gate is pulling from the
updates repository. This patch updates the script to make it work again.

Closes-bug: #1468917
Change-Id: I88a1bc794246beb156d4301bd503fa51a7cd2cce
2015-06-26 06:35:00 +00:00
OpenStack Proposal Bot
254dfb4584 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I7b7d8cf9ce634d5fd00b215681ccc3ea09a997c1
2015-06-26 06:16:01 +00:00
Corey Wright
8422e975b3 Correct RPCVersionCapError message
This change adjusts the exception message to be more in line with the
version compatibility algorithm so as to accurately portray the
problem to the log recipient.

The RPCVersionCapError message can be grossly incorrect when the
requested message's major version is lower than the specified version
cap's major version, declaring the requested message version as too
high, when the real error is that the major versions differ (as major
versions are assumed to be incompatible).

Example:

    RPCVersionCapError: Requested message version, 3.23 is too
    high. It needs to be lower than the specified version cap 4.0.

Change-Id: Iceef999ed385f2ba77449c568127f50f83d47196
Closes-Bug: 1468525
2015-06-24 17:18:46 -05:00
Doug Hellmann
3b6ca5b6de Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: I05a408b76d4f31b803769a27759e91df770511bb
2015-06-19 18:06:50 +00:00
Jenkins
a3a3c3faa8 Merge "Use inferred=True by default" 2015-06-16 09:49:22 +00:00
Jenkins
f3d70a923d Merge "Enable amqp's protocol unit tests everywhere" 2015-06-16 09:42:28 +00:00
Flavio Percoco
c8845b4bef Use inferred=True by default
Rabbitmq's amqp1.0 plugin doesn't have support for vbin8, which is the
default encoding used by qpid-proton. In order to workaround this issue
we should use inferred=True.

Closes-bug: #1465409
Change-Id: Id265917244d7e152c5e13a10df367a3e59de8e50
2015-06-15 23:16:57 +02:00
Flavio Percoco
f06b19628f Enable amqp's protocol unit tests everywhere
Now that python-qpid-proton has taken an approach similar to zmq's, it's
possible to install it in boxes where the C libraries are not present in
the system. This patch takes advantage of that to enable amqp protocol's
tests everywhere.

Change-Id: Ibce4c791aafadf45fa876d6a4f5373fde94769ff
2015-06-15 20:52:24 +02:00
Jenkins
4062c1caa6 Merge "Switch badges from 'pypip.in' to 'shields.io'" 2015-06-15 17:22:13 +00:00