summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Only unpack replies on caller.Eric Windisch2013-01-311-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening the messages is unnecessary in ZmqProxy, given that the msg_id is already in the (zmq-specific) message envelope. Additionally, by not opening the messages, we save a bit of complexity. This avoids having to deserialize and reserialize messages in ZmqProxy, a necessary improvement for trusted-messaging and should also have a markable performance benefit. Also cleans up msg_id handling a bit. Change-Id: I31f365b9e1040503206b1d8320a0266a8121c821
* | | | Merge "Use bytes instead of str"Jenkins2013-02-051-4/+3
|\| | | | |/ / |/| |
| * | Use bytes instead of strEric Windisch2013-01-311-4/+3
| |/ | | | | | | | | | | | | | | | | | | | | Clarifies that str is the wrong datatype for passing messages over ZeroMQ. This distinction will be more important with the eventual migration to Python 3.0, but (I hope) this also helps clarify WHY typecasting is performed before sending messages. Change-Id: I4dd4661a5730a24ba7b514520b0429b721b05e9c
* | Merge "Use importutils for matchmaker import."Jenkins2013-02-021-15/+1
|\ \
| * | Use importutils for matchmaker import.Eric Windisch2013-01-301-15/+1
| |/ | | | | | | | | | | | | Per Vish's suggestion. this should be simplier, cull redundant code, and otherwise cut the fat. Change-Id: I9fa3effdc8e9e2f3f124690ecf77ee8bb7d4d39e
* | Merge "Dict args safe processing."Jenkins2013-02-021-8/+9
|\ \
| * | Dict args safe processing.Eric Windisch2013-01-281-8/+9
| | | | | | | | | | | | | | | | | | | | | Improve safety of dict args in process() Change-Id: I0eae36ca6566c1b60f0a01ebee57ae8a7530fcb1
* | | Fixes 'not in' operator usageZhongyue Luo2013-01-311-1/+1
| |/ |/| | | | | Change-Id: Ibac9853fc72e2452fa5e2b3a493bd03523faabfb
* | Add TTL to AMQP messagesBrent Eagles2013-01-283-10/+27
| | | | | | | | | | | | | | | | | | | | This patch sets a TTL derived from the timeout parameter used when invoking the RPC. Needed for: * Bug 1053614 Change-Id: Idaf9a2a972feac3f95f170c52632033b027b4414
* | Fixes "is not", "not in" syntax usage.Zhongyue Luo2013-01-281-1/+1
|/ | | | | | | | Replaced "not ... is" to "is not" Replaced "not ... in" to "not in" Removed a redundant parenthesis Change-Id: I9564ab1207ccdcb32d7c2bb9e8f29658b2232ff9
* Fixes an import order nitZhongyue Luo2013-01-161-1/+1
| | | | Change-Id: Ic47deb67c5dad123c8937e3468d798eefe045280
* Merge "Allow rpc drivers to always be imported"Jenkins2013-01-152-10/+20
|\
| * Allow rpc drivers to always be importedMark McLoughlin2013-01-152-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qpid and zmq drivers current can't be import unless their respective libraries are installed and neither are currently listed in test-requires. This prevents us from being able to use nosetests --with-doctests because the import failure is seen as a test failure. Fix this issue by making the import always succeed and deferring failure until the module's APIs are actually used. This will also help Nova's sample config file generation since it will allow the generate-sample tool discover config options for these drivers even when the messaging libraries aren't installed. Change-Id: I30087fd33eef41d50d1a374cb5694dc15c43d1da
* | Merge "Rework zmq setup and cleanup"Jenkins2013-01-151-26/+18
|\|
| * Rework zmq setup and cleanupMark McLoughlin2013-01-151-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register config options at import time and remove the register_opts() function. It seems this isn't being used. Add accessor methods for ZMQ_CTXT and matchmaker so that they are lazily created rather than created at import time. Remove the rpc_zmq_matchmaker override in the tests since MatchMakerLocalhost is the default anyway. We were setting it with an incorrect value, but only after the matchmaker had already been created. Change-Id: I2520252c64d70e4c4903e34d07952fed43e70ebe
* | Merge "Fix zmq socket.close() with eventlet 0.9.17"Jenkins2013-01-151-3/+7
|\ \ | |/ |/|
| * Fix zmq socket.close() with eventlet 0.9.17Eric Windisch2013-01-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bug/change in eventlet 0.9.17 blocks the kwargs from close() from passing through to pyzmq. As this code was only explicitly passing defaults, no argument is necessary. This addresses file descriptor leaks reported in bug 1099185. This bug does not affect installations with eventlet<=0.9.16 The code will now log an error if a socket cannot be closed. Change-Id: Id438dab9744042328b7fac44693d02e116d8c1d9
* | Merge "Add missing parameter to impl_fake notify function."Jenkins2013-01-151-1/+1
|\ \
| * | Add missing parameter to impl_fake notify function.Gary Kotton2013-01-141-1/+1
| |/ | | | | | | | | | | The envelope was missing. Change-Id: I3ab8f573e6c5020bd564ad78de29e6c285695f2c
* | Merge "reusable ZmqProxy service initialization"Jenkins2013-01-151-0/+33
|\ \
| * | reusable ZmqProxy service initializationEric Windisch2013-01-131-0/+33
| |/ | | | | | | | | | | | | | | | | | | | | Move near-identical proxy setup code from oslo-zmq-receiver and test_zmq into ZmqProxy's consume_in_thread method Provides code reuse and simplifies the tests and receiver binary. Change-Id: I1324eacfa2a456599d5fd462b6476ddf659e95c4
* | Merge "call() to accept serialize and force_envelope"Jenkins2013-01-151-3/+6
|\ \ | |/ |/|
| * call() to accept serialize and force_envelopeEric Windisch2013-01-101-3/+6
| | | | | | | | | | | | | | | | | | | | The serialize and force_envelope options were being stripped from call(). Now, when call() is invoked, these options are passed and respected. Change-Id: I69355606b06ab2ec87765fe6ddba7baaa68e5754
* | zmq-receiver msg forwarding in greenthreadsEric Windisch2013-01-101-20/+48
|/ | | | | | | | | | | | | | | | Because PUSH sockets can block and there may not be PULL consumers, the oslo-zmq-receiver process may stall in certain senarios. Improves error handling in ZmqProxy. This addresses bug 1097856. Additionally, this bug seems to improve (but not necessarily fix) the behavior reported in bug 1065532. Change-Id: I6df6035a6676c5bcdddaec7a332ac77e621ba9f3
* Merge "rpc method arguments should be dict, not list"Jenkins2013-01-081-2/+2
|\
| * rpc method arguments should be dict, not listEric Windisch2013-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default arguments were being set to a list instead of a dict. This caused problems if the args key was missing in the msg argument to the call/cast methods. Adds tests to check if RPC cast/call work without arguments. Changes and documents the _test_cast method arguments, allowing for more flexibility and code reuse. fixes bug 1089750 Change-Id: I854dc3fcad8936695feb4414f3862672cf98c5d1
* | Fix serialization in impl_zmq.Russell Bryant2013-01-071-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the rpc message envelope patch went in, the serialization done in impl_zmq was replaced with what is done in rpc.common. Instead, it just needs to be done as an additional stage of serialization. The reason is that the amqp drivers can handle passing dicts into the messaging libraries. The zeromq library can not handle that, so it has to ensure it is a string before passing it down to the library. This patch restores the original (unmodified) _serialize() and _deserialize() methods in impl_zmq that were removed and calls them as appropriate. Change-Id: I09cac780c9a9b15390229c63d71e360120548b3d
* | 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 "Fix debug message in multicall of rpc.amqp"Jenkins2013-01-061-1/+1
|\ \ \
| * | | Fix debug message in multicall of rpc.amqpHengqing Hu2012-12-271-1/+1
| |/ / | | | | | | | | | Change-Id: Ib5ed65df937e9fe4e36cdf7d0ce92b627f22dbd3
* | | Merge "Optionally add message envelope to notifications."Jenkins2013-01-066-22/+27
|\ \ \
| * | | Optionally add message envelope to notifications.Russell Bryant2013-01-036-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-053-0/+24
|\ \ \ \
| * | | | Ensure proxy callback threads exit during testsMark McLoughlin2013-01-033-0/+24
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Sanitize cells calls.Michael Still2013-01-041-10/+16
| |/ / |/| | | | | | | | | | | | | | | | | Cells puts the data to be sanitized deeper into the message. We should get this into oslo ready for when cells lands. Change-Id: Ic5d111f11c979a179e0edcb314feb3f9d93f66ce
* | | Merge "Add a rpc envelope format version number."Jenkins2013-01-036-59/+149
|\ \ \
| * | | Add a rpc envelope format version number.Russell Bryant2013-01-026-59/+149
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / Register the control_exchange RPC optionMark McLoughlin2012-12-112-13/+9
|/ | | | | | | | | | | Fixes bug #1031725 Have the control_exchange option be registered by Oslo, but allow projects to override the default of 'openstack' by doing e.g.: rpc.set_defaults(control_exchange='nova') Change-Id: Ic6e534d9a70a1cfc94207b78caa57e897cf78f63
* Merge "Allow remote stdlib exceptions to be deserialized"Jenkins2012-12-081-0/+1
|\
| * Allow remote stdlib exceptions to be deserializedMark McLoughlin2012-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | Fixes bug #1086798 Add 'exceptions' to allowed_rpc_exception_modules so that stdlib exceptions (like NotImplementedError) can be deserialized from a RemoteError. Change-Id: I57f40fed2a86cc08fb64b81d648c71cd7db8027c
* | Merge "Allow exceptions to pass over RPC silently"Jenkins2012-12-064-7/+58
|\ \
| * | Allow exceptions to pass over RPC silentlyDan Smith2012-12-064-7/+58
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one service performs an operation on behalf of another, the act of passing back an exception (even a known one) causes a lot of scary log messages about the (presumed to be) error case. This patch adds a client_exceptions decorator common/rpc/common.py, which allows RPC services to declare the list of expected exceptions for each method. If such an exception is raised during the RPC dispatch, it is wrapped in a ClientException so that the RPC layer can gracefully pass it back without overly-verbose logging. This will allow us to fix nova bug 1084707 Change-Id: I4e7b19dc730342091fd70a717065741d56da4555
* / Fix qpid cast_to_server regression.Russell Bryant2012-12-051-0/+7
|/ | | | | | | | | | | | | This patches addresses a regression in the qpid driver for the cast_to_server and fanout_cast_to_server methods. The regression was introduced in 86952852c1dadd54f1294ae0adba01cfe827b8ce. There are test cases that cover this code, but unfortunately they are not being run by jenkins because python-qpid is not available in pypi. Fix bug 1086848. Change-Id: I89d4f81149f9a05c578b5ec544c5e34311484c6c
* Use json instead of jsonutils in rpc.impl_fake.Russell Bryant2012-12-011-2/+7
| | | | | | | | | | | | | The fake rpc backend uses json just to make sure the data that was passed in can be serialized. Our jsonutils module makes this check a no-op, because it will automatically convert the data we pass in as primitive types if needed. Change this module back to using the json module directly and add a comment about why we don't use jsonutils here. Also add a test that ensures that non-primitive types raise an exception in the fake rpc driver. Change-Id: I61f46242cb98c875a94d86283e30efb24cc580ad
* Merge "Provide i18n to those messages without _()"Jenkins2012-11-291-2/+2
|\
| * Provide i18n to those messages without _()Davanum Srinivas2012-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug 1081498 There are a few log messages without _(), but a lot messages with _(). Wrap these log messages with _() in order to make the code consistent. fix missing imports for _ Pass the log message and interpolation argument(s) to the logger separately remove extra parens rework the patch against latest trunk Change-Id: Ib0a7b0f9c57aadfbc2cfc477c6123b885c9c6060
* | Merge "Qpid H/A cluster support"Jenkins2012-11-291-9/+14
|\ \
| * | Qpid H/A cluster supportEugene Kirpichov2012-11-291-9/+14
| |/ | | | | | | | | | | Implements blueprint qpid-roundrobin-reconnect Change-Id: I01b65e6c33a238663667e9b6023b90172f1b77dd