summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_kombu.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add support for heartbeating in the kombu RPC driver"HEADmasterJenkins2013-07-081-0/+4
|\
| * Add support for heartbeating in the kombu RPC driverKiall Mac Innes2013-07-081-0/+4
| | | | | | | | | | | | | | | | | | This aides in detecting connection interruptions that would otherwise go unnoticed. Fixes bug #856764 Change-Id: Id4eb3d36036969b62890175d6a33b4e304be0527
* | Replace sys.exit by a RPCExceptionMehdi Abaakouk2013-07-021-8/+5
|/ | | | | | | | This change replace sys.exit by a RPCException like the zmq implementation does, to allow library users to handle the case of the rpc failure in their applications. Change-Id: Iafda7bfa20840fa5488dece1d5ad49e2b14b73b5
* Make AMQP based RPC consumer threads more robustRaymond Pekowski2013-06-251-0/+2
| | | | | | | | | | | | | | | bug 1189711 Should RPC consume_in_thread() be more fault tolerant? There are unprotected holes in the thread kicked off by RPC consume_in_thread such that an exception will kill the thread. This exists for both the service (TopicConsumer) and the new reply proxy (DirectConsumer) consumers. This patch plugs those holes as close to the base of the consumer thread as possible by catching all non-caught exceptions and retrying with sleeps between retries and some pacing of the log output to prevent log flooding. Change-Id: I0d6ec8a5e3a310314da201656ee862bb40b41616
* Optionally reject messages on exception.Sandy Walsh2013-06-201-13/+38
| | | | | | | | | Rather than blindly ack() all messages, consumers can be created that reject() the message if an exception occurs in the callback. Currently only implemented in kombu driver. Change-Id: I308dd794b50966e3a189d31b2b51fdac36cd7d3a
* Enable hacking H402 testSergey Lukjanov2013-06-031-28/+28
| | | | | | H402 one line docstring needs punctuation Change-Id: Ie848453cace318d8310cdf0234c512f4c1121119
* Enable hacking H403 testSergey Lukjanov2013-05-301-2/+3
| | | | | | H403 multi line docstring end on new line Change-Id: I33249651026b54ef346214965e909835288bb14e
* Improve Python 3.x compatibilityDirk Mueller2013-04-221-4/+4
| | | | | | | Mechanical translation of deprecated constructs to 3.x compatible variants. Change-Id: I4988d0ac656903e0d0320aaa8361d4eeb774a0f9
* Fix Copyright Headers - Rename LLC to FoundationDavanum Srinivas2013-03-111-1/+1
| | | | | | One code change, rest are in headers Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
* Don't log a traceback on rpc call timeout.Russell Bryant2013-03-021-2/+2
| | | | | | | | | | | There are cases where an rpc call is gracefully handled. The rpc drivers should just let the caller deal with this and decide whether it is an error worth logging a traceback over. Otherwise, we unnecessarily raise alarm by leaving a mess in the log file. Fix bug 1137994. Change-Id: I0e831ddcc43ffea78aae1fb5e46c5037c461b2a1
* Revert "Fast serialization of RPC envelopes for Kombu"Russell Bryant2013-02-201-26/+2
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 22c497097b0d0bd461be40a7a03290aa0b4179f2. I'm not convinced that this isn't just a micro-optimization when compared to the rest of the work that a given OpenStack service performs as the result of these messages. The implementation is also problematic. It depends on using a '\0' byte as a separator and assumes that '\0' will not exist anywhere else in the message. This seems to be asking for trouble. If future data could ever have a '\0' in it, this will be broken. Further, if a user could get a '\0' in a message directly with user-supplied input, this could result in a security vulnerability. Lastly, this has a significant impact on consumers of notifications that are outside of OpenStack code, which have been the primary use case of notifications (Ceilometer is changing that to a degree). I don't think consumers of notifications should have to implement this deserialization method. Change-Id: Ib3163ca98f568bf9f789d4b64bcc6d72e0fcb459
* Merge "Fix "DirectConsumer needs mirrored queue support""Jenkins2013-02-201-0/+1
|\
| * Fix "DirectConsumer needs mirrored queue support"Kei Masumoto2013-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | Currently TopicCosumer and FanoutConsumer can be used Mirrored Queue support, but not DirectConsumer. This patch fix this issue. Fix bug 1124162 Change-Id: I68ae23467ae810ce0ec917a4cb34a488283f401c
* | Fast serialization of RPC envelopes for KombuEric Windisch2013-02-191-2/+26
| | | | | | | | | | | | | | | | | | By flattening the dictionary and turning it into a fast-serialized string, we save ourselves from Kombu's very slow JSON serialization routines. Change-Id: I64796265c7cc89a05406faabd8d7b253fe3b8acb
* | Use oslo-config-2013.1b3Mark McLoughlin2013-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cfg API is now available via the oslo-config library, so switch to it and remove the copied-and-pasted version. Add the 2013.1b3 tarball to tools/pip-requires - this will be changed to 'oslo-config>=2013.1' when oslo-config is published to pypi. This will happen in time for grizzly final. Remove the 'deps = pep8==1.3.3' and 'deps = pyflakes' from tox.ini as it means all the other deps get installed with easy_install which can't install oslo-config from the URL. Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
* | Merge "Fix Lack of reconnecting operation when using rabbitmq mirrored queue"Jenkins2013-02-141-1/+2
|\ \
| * | Fix Lack of reconnecting operation when using rabbitmq mirrored queueKei Masumoto2013-02-131-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | On using Mirrored Queue feature in impl_kombu.py, there is a case that messages are lost because amqp client does not handle exceptions properly when rabbitmq is dead on the way to wait return value of call(). This patch fix this and enables ampq client reconnecting slave rabbitmq. Fixes bug 1102051 Change-Id: Ia7a1b9067f7ea4639195a1548de29e0364368e51
* / Add join_consumer_pool() to RPC connectionsDoug Hellmann2013-02-131-0/+24
|/ | | | | | | | | | | | | | | blueprint move-listener-framework-oslo bug 1047015 bug 1111632 Ceilometer and Quantum use private methods of the RPC connection object to configure themselves to listen to a queue shared among a group of workers. This change adds a public method to the RPC connection to support this use case, without resorting to using private API calls. Change-Id: I3a89f1dfdcf8accca70cf305f7a31315bea093d8 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
* Mark password config options with secretMichael J Fork2013-02-041-1/+2
| | | | | | | | Config object supports masking values when writing out if the secret flag is set on the option definition. This change flags all oslo-incubator options containing a password. Change-Id: I78451c4fdfdb3d6e28a7bd5f35d1c4c9a1b2be99
* Add TTL to AMQP messagesBrent Eagles2013-01-281-7/+13
| | | | | | | | | | This patch sets a TTL derived from the timeout parameter used when invoking the RPC. Needed for: * Bug 1053614 Change-Id: Idaf9a2a972feac3f95f170c52632033b027b4414
* Merge "Close kombu.connection.BrokerConnection correctly"Jenkins2013-01-071-1/+1
|\
| * Close kombu.connection.BrokerConnection correctlyHengqing Hu2012-12-281-1/+1
| | | | | | | | | | | | | | | | | | Make kombu.connection.BrokerConnection use release() to close the connection. It has no such attribute as close(), since AttributeError is in connection_errors, the fault was previous concealed by the following catch statement. Change-Id: I9f7da2c64f9d408aa2a9ddf723ea83291887cff6
* | Merge "Optionally add message envelope to notifications."Jenkins2013-01-061-2/+3
|\ \
| * | Optionally add message envelope to notifications.Russell Bryant2013-01-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When message envelopes were added for rpc messages, notifications were explicitly left out. This was due to the fact that notifications are consumed outside of OpenStack. However, notification consumers will likely want to eventually start taking advantage of some of the features that the envelope is a prerequisite for, such as message signing. This patch adds a new notification driver that produces message based notifications including the message envelope. Related to blueprint version-rpc-messages. Change-Id: Iaa8b437e6b4f64053f4b02bf486516f60bb020e9
* | | Merge "Ensure proxy callback threads exit during tests"Jenkins2013-01-051-0/+10
|\ \ \ | |/ / |/| |
| * | Ensure proxy callback threads exit during testsMark McLoughlin2013-01-031-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the consumer side, each message is consumed in a separate thread but we currently have no way of waiting for all these threads to complete. In BaseRpcTestCase.test_call_timeout(), we complete the thread while there is still a message handler running on the other side. This can mean the consumer attempting to send its reply while other tests are running, which clearly is a bad thing. Make the connection close() and reset() methods in the kombu and qpid drivers wait on proxy object threads before returning to avoid this situation. Change-Id: I8fb84b1dc7f31196ef27a5d1f8c4a3346b03e0ae
* | Merge "Add a rpc envelope format version number."Jenkins2013-01-031-1/+2
|\ \
| * | Add a rpc envelope format version number.Russell Bryant2013-01-021-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a message envelope that includes a envelope format version number. This message envelope will allow us to embed additional metadata later on, such as a signature for the message payload. Up to this point, we've deferred message serialization as a responsibility of the messaging library we're using by passing it a message as Python types and letting it deal with how to pass it over a network. This patch adds json serialization in the rpc layer of the application message payload before passing the message down into the messaging library. There are some benefits to be gained by doing a pass at serialization ourselves. As an example, we occasionally hit serialization bugs that only affect some messaging drivers. The kombu driver has always had a nice advantage. It uses anyjson internally for serializing messages, which we hook into using our jsonutils module. When there is a problem serializing, we automatically use to_primitive() to fix it. This patch allows all drivers to take advantage of this automatic message fix-up. This also creates a convenient common hook point for messages coming in and out of the system, regardless of the driver in use. While this changes the base format of the messages sent between nodes, it has been done in a backwards compatible manner. The new message format will not be used by default. The idea is that all nodes will be upgraded to a version that is capable of receiving the new format (Grizzly) before switching it on. We will turn it on post-Grizzly. Implement blueprint version-rpc-messages. Change-Id: Ib6b2d11ca42abaa64c40986d72233e7048e504a0
* / Don't use exclusive queues for fanout and directVishvananda Ishaya2012-12-281-4/+4
|/ | | | | | | | | | | The use of exclusive queues can cause issues on reconnect if the rabbit server hasn't deleted the queue already. We might as well use exclusive=False so that we can reconnect to the queue if necessary. Fixes bug 1094358 Change-Id: I35bd903737d6054e8856b0003b0b8af97fd21c91
* Clean up dictionary use in RPC driversDoug Hellmann2012-11-071-7/+7
| | | | | | | | Initialize the base dictionary before setting overrides. Do not modify the argument passed to Connection.__init__. Change-Id: I5479483509efe6966094b50af2703e566a99dace Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
* kombu's fanout_cast_to_server was calling wrong methodChris Behrens2012-11-011-1/+1
| | | | | | | | | Make it call the common amqp method fanout_cast_to_server vs cast_to_server. Fixes bug 1074113 Change-Id: If06bde93dab94c6030465a5e7ba329d8936c69e3
* Merge "Use queue_arguments for fanout consumers too."Jenkins2012-10-301-0/+1
|\
| * Use queue_arguments for fanout consumers too.Sam Morrison2012-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | Fixes bug 1071528 queue_arguments (currently only x-ha-policy for now) were only set for topic consumers, this adds support for rabbit HA for fanout consumers too. Change-Id: I0d5c0393b49cf249262d93a64f6348caa76ef8dd
* | Import order clean-upZhongyue Luo2012-10-291-1/+1
|/ | | | | | Reorder imports by full module path Change-Id: If619b4b50aa052401f7fa65df57b74d4ad1b65a6
* Add exchange_name parameter to TopicConsumerJulien Danjou2012-09-271-3/+5
| | | | | | | | | | | In Ceilometer, we need to consume messages from different exchanges of type 'topic', so being able to specify the exchange name rather than using the default in TopicConsumer is necessary. This fixes bug #1055483 Change-Id: Ibbaec8496f24c0b221cf489258af1e7fe362e84a Signed-off-by: Julien Danjou <julien@danjou.info>
* Extracted parse_host_port into network_utils.Eugene Kirpichov2012-09-261-2/+2
| | | | Change-Id: I77bcbf03a18659cfa62e99da9ba2136f8348022b
* LOG.exception() should only be used in exception handlerJohannes Erdfelt2012-09-251-9/+10
| | | | | | | When used outside of an exception handler it will print the message and then 'None', which isn't useful at all. Change-Id: If687a764dea4c7dc0046d7c3054318f2a751a2ea
* Merge "Don't deprecate rabbit_host and rabbit_port"Jenkins2012-09-251-3/+4
|\
| * Don't deprecate rabbit_host and rabbit_portMark McLoughlin2012-09-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Where a single RabbitMQ broker node is used (rather than a cluster of nodes) it is simplest for users to just set the rabbit_host option. Often users will not need to specify a port number at all. Similarly, where a cluster is used, it is simplest for the user to just specify a list of node addresses in rabbit_hosts and assume that all nodes are listening on the port specified in rabbit_port. Change-Id: I4227541676dffc50cd6116225de0cec0afa36a41
* | DRY up mirrored Rabbit queue declarationMark McLoughlin2012-09-251-5/+17
|/ | | | | | | Consolidate the setting of x-ha-policy to a single place and add soem documentation. Change-Id: I35751e43c3ac15c142996f291e0ec609cab4948a
* Support for several HA RabbitMQ servers.Eugene Kirpichov2012-09-251-29/+49
| | | | | | | | Use the rabbit_ha_queues boolean option. It is off by default, and you need to wipe RabbitMQ Mnesia database (/var/lib/rabbitmq/mnesia) when changing it. Change-Id: Id06692a142d1e5316602f6ceed4ccad615ce74c1
* Use pep8 v1.3.3Zhongyue Luo2012-09-131-6/+10
| | | | | | | Fixed indents which violate pep8 1.3.3 Also added .mailmap file to coalesce commits Change-Id: Ia7a788a28e6c0fd9cb52fb7ea477cddd7d589e58
* Make projects define 'control_exchange'.Russell Bryant2012-09-111-6/+7
| | | | | | | | | | | | | | | The 'control_exchange' option needs to have a project-specific default value. Just don't register this option and expect it to be registered by the project using this code, at least for now. ****** IMPORTANT NOTE WHEN IMPORTING THIS CHANGE ****** If you are importing this change into a project that uses rpc, you must add the control_exchange option in your code! ******************************************************* Change-Id: Ida5a8637c419e709bbf22fcad57b0f11c31bb959
* Add missing gettextutils importsDoug Hellmann2012-06-221-0/+1
| | | | | | | | | This change fixes a problem we found in the ceilometer test suite under Python 2.6. The name '_' is not defined globally, so nose reports import errors trying to scan the modules changed here. Change-Id: Ie94cc4effba457342e25f991cf481fc40a1d8cf3
* Update common code to support pep 1.3.Gary Kotton2012-06-181-106/+98
| | | | | | bug 1014216 Change-Id: I3f8fa2e11c9d3f3d34fb20f65ce886bb9c94463d
* Add rpc to openstack-common.Russell Bryant2012-06-061-0/+758
Implements blueprint common-rpc. This patch imports nova.rpc to openstack-common. All of the necessary changes to the core code to make it compatible with openstack-common have been done in nova, so the only changes made here are to imports. There are more changes made to the tests, but nothing that changes the core functionality of the tests. Change-Id: I17330aa4adfd0f22c449a2376833c7fe9dfd0cf1