Document the plugins available for executors and notifiers.
Fix the formatting in the aioeventlet executor so the docstring renders
properly.
Change-Id: I7709b65f5aa68fab3822b4de11640309aa07b1d7
This change introduces to possibility for the consumer application
to change the default oslo.messaging config options.
Same API interface as oslo.db have been taken.
The first option is executor_thread_pool_size.
This option was called rpc_thread_pool_size, but because it's used by
notification and rpc 'executor_thread_pool_size' looks a better name.
Changing executor_thread_pool_size default will be useful for ceilometer
the default of 64 is really to small to consume many notifications at
once for batching them. When is clearly sufficient for rpc stuffs.
Change-Id: Iea0d7a72e38d27c600403c815258aa5eee0d0c8c
quote method has a safe parameter which is set to '/' so when
the end user has a / in the rabbit_password then we end up leaving
that in the url which ends up looking like:
amqp://stackrabbit:pass/word@10.0.0.9:5672//
Which is clearly invalid, so we should set safe parameter to '' which
allows the url to be constructed properly (see transport.py
TransportURL.__str__ method works this work)
Closes-Bug: #1474933
Change-Id: I14fb54440d0925f3676e18d13182ed0fa9c34ca2
Sometimes the gate fails because a test take a bit more time than
expected, this change adjusts this.
Closes-bug: #1475502
Change-Id: I7396c9de82aab18e84c0e08cc1f6f0903884130a
It appears the the callback variable that was being called on
future done was not the right one, due to the lambda capture
mechanism referring to a lazy variable which would potentially
be a different callback by the time the future would finish so
make sure we capture the right one and ensure the future has access
to it.
This adds a helper method that submission will go through
to ensure that the callback variable is correctly captured
in the created lambda and also ensures that the incomplete futures
list is cleaned up (when the future is done).
The notification listener tests use now eventlet to show up this
issue that doesn't occur with blocking executor.
Closes-bug: #1474943
Closes-bug: #1475307
Change-Id: I23e393d504662532572b5b344b87387be6d7bcb1
Blueprint remove-namespace-packages
Depends-on: I2eeef93ee2e61a721c69f62add819f93f62f077d
for openstack/ceilometer
Depends-on: I26390dd908769be5f1a5b70be22d3b98e3a45563
for openstack/ceilometermiddleware
Depends-on: Ifa8baab33cdb3e606cf175a8c29c3a4ef6c44480
for openstack/glance
Depends-on: I029c3260051aa48cfaae428c096c1ac7b43b2bd2
for openstack/ceilometermiddleware
Change-Id: I8c5595bbafa82db33f62fa47d214f5cb756a2639
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
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
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
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
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
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
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
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
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
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
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