summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Fix Copyright Headers - Rename LLC to Foundation"Jenkins2013-03-123-3/+3
|\ \
| * | Fix Copyright Headers - Rename LLC to FoundationDavanum Srinivas2013-03-113-3/+3
| |/ | | | | | | | | | | One code change, rest are in headers Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
* / Keep exc_info() to prevent an internal errorHaiwei Xu2013-03-111-3/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug 1135539 When SysLogHandler is configured in UDP socket mode, the user who doesn't have the admin privilege got the unexpecting internal server error(HTTP 500) in "nova dns-create-private-domain" command. This bug occurs as the call graph drew below: |--ProxyCallback._process_data():amqp.py |--LOG.exception() | : | |--BaseHub.switch():hub.py | |-- clear_sys_exc_info() | |--ctxt.reply(None, sys.exc_info(),..) | : | |--serialize_remote_exception():common.py |--failure_info#(None,None,None) The sys.exc_info() is cleared by the clear_sys_exc_info(), but it is called again by the ctxt.reply(). This patch prevents the internal error and returns the details of the forbidden error(HTTP 403) which is expected. Change-Id: I549b4b2365c53c401edc80bbe30bcde249d27b85
* Merge "Preserve exceptions in impl_zmq."Jenkins2013-03-061-8/+9
|\
| * Preserve exceptions in impl_zmq.Russell Bryant2013-03-051-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is complication with re-raising exceptions and our usage of eventlet. If the code in the exception handler accesses the db or rpc in the exception handler, it will no longer be able to re-raise the exception. Using excutils.save_and_reraise_exception() works aorund this issue. The most common error is calling LOG.error() or LOG.exception(), as it is possible for these to go access rpc. There is an option to turn on notifications for these errors. Fix bug 845866. Change-Id: Ic914bba4703200ed114a42e3a55402883b430407
* | Simple code cleanupMatthew Sherborne2013-03-061-1/+1
|/ | | | | | | | | * Fix an exception that was raising a tuple * Remove unused imports * Remove unused exceptions * Remove extra blank lines Change-Id: I9127be991e9081dc173525c9b57ea297f389d16d
* Merge "Don't log a traceback on rpc call timeout."Jenkins2013-03-042-4/+4
|\
| * Don't log a traceback on rpc call timeout.Russell Bryant2013-03-022-4/+4
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Redis-based matchmaker"Jenkins2013-03-013-2/+324
|\ \
| * | Redis-based matchmakerEric Windisch2013-03-013-2/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces a reference implementation of a matchmaker (based on redis) that supports dynamic host/topic registrations, host expiration, and hooks for consuming applications to acknowledge or neg-acknowledge topic.host service availability. Implements blueprint advanced-matchmaking Change-Id: I8608d2089fca118b0e369f2eb5c6aedacf6821fe
* | | Zmq correct envelope param for notify()Eric Windisch2013-02-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The notify parameter was expected as a kwarg, although __init__.py expects this to be a standard argument. Tests are not yet covering this, but are forthcoming. Change-Id: Id6a0a81ef250e43c7ab3dc9d5392f89752d0f313
* | | Zmq notifier topic manip fix.Eric Windisch2013-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZeroMQ driver needs to manipulate the topic for notifications because the period is used as a delimiter internally. The code was already trying to perform this modification via topic.replace, but was not storing the result. Change-Id: I02a174dd96ff9181f6d7460fd41434ea05fb39d4
* | | Fixes import order nitsZhongyue Luo2013-02-261-2/+3
| |/ |/| | | | | Change-Id: I6085bb4a0b990985c8f7a013c89b7d5acafdf312
* | AMQP: skip duplicate messagesKei Masumoto2013-02-222-0/+50
|/ | | | | | | | | | | | | | | | | | | | When using rabbit's mirrored queues or qpid's replicated queues, there are conditions under which you can receive the same message twice. One such condition is where a message has been sent to a consumer but before an ack is received by a consumer, the master fails over to a slave and the slave resends the message. Note that the consumer may have sent the ack, but it was lost as the master went down. Dispatching the same message twice is obviously something we want to avoid. In order to do so, we add a unique_id to each message sent and have consumers maintain a fixed length queue of recently seen unique message IDs. Before dispatching any received message, the queue is checked and the message is skipped if it is a duplicate. Fixes bugs 1107064. Change-Id: I5bfacadbdf7de8b34d6370b9aa869c271957692d
* Merge "Revert "Implement replay detection.""Jenkins2013-02-211-62/+19
|\
| * Revert "Implement replay detection."Mark McLoughlin2013-02-201-62/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts Ib0260a0c62e3d312d2e3448a125bed64d861319e (commit a603678) The issue we're trying to fix here is bug #1107064 - when using mirrored queues with AMQP, acks can be lost while a master is failing over to a slace causing the new slave to re-send messages which had previously been acked. The "replay detection" code applies to more than just amqp and also has the appearance of a security measure (e.g. the use of the term 'nonce') when clearly it serves no security purpose until we actually have message signing. Revert the "replay detection" approach in favour of the more targetted amqp bugfix. Change-Id: I8b8d15835c8b4c85cd388f5df08b60ff4c74e38d
* | 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
* Fix IPC direct topic routing.Eric Windisch2013-02-191-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Direct messages were being stripped of the host value when performing IPC forwarding. This caused direct topics to be round-robined to all services running on the system consuming from the same base topic name. i.e. if 'scheduler.host1' and 'scheduler.host2' were running on the SAME machine, messages to 'scheduler.host1' may have been routed to 'scheduler.host2'. Now, mulitple processing specifying different rpc_zmq_host parameters will consume on separate direct topics and will not round-robin to other processes. Adds a zmq-specific test to ensure that messages to directed topics are not consumed by other consumers of direct topics sharing a bare topic on the same host. Fixes bug 1123715 Change-Id: I939c24397e58492fc16561666aed3ca891325e9c
* 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
* | Merge "Fast serialization of RPC envelopes for Kombu"Jenkins2013-02-201-2/+26
|\ \
| * | 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
* | | Merge "Implement replay detection."Jenkins2013-02-201-19/+62
|\ \ \
| * | | Implement replay detection.Eric Windisch2013-02-191-19/+62
| |/ / | | | | | | | | | | | | | | | Bumps the envelope revision to 2.1 Change-Id: Ib0260a0c62e3d312d2e3448a125bed64d861319e
* / / Support RPC envelopes in impl_zmqEric Windisch2013-02-191-26/+67
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch began as a set of tests verifying the functionality of sending and receiving RPC envelopes when using impl_zmq. It was discovered that when enabled, RPC envelopes were not actually working, The ZeroMQ driver includes its own envelopes. This patch introduce versioning to that envelope, eliminating the previously reserved 'style' field. A new iteration of the zeromq-envelope is introduced, 'impl_zmq_v2'. It specifies that the zeromq-envelope should be followed by an unpacked array representing key value pairs of the standard RPC Envelope. Because the key-values of the RPC Envelope can be successfully transformed with bytes(), this prevents the need to double-serialize the content traversing the message bus. Also removes some unused imports. Closes bug 1123709 Closes bug 1055446 Change-Id: Ib04e3d092c9596146f1048d3502ac248496d313b
* | blueprint amqp-rpc-fast-reply-queueRaymond Pekowski2013-02-181-9/+158
| | | | | | | | | | | | | | | | | | | | | | For AMQP based RPC, specifically RabbitMQ and Qpid, this change replaces the dynamically created RPC call reply queue with a single queue that is created on the first RPC call and used on all subsequent calls. It provides backward compatibility on the callee side by recognizing downlevel callers and on the caller side by adding a config option to revert to the old dynamically created queue based upon the msg_id. Change-Id: Idb09a71472866bd3950f58d4f7f45a3181eb40fc
* | Use oslo-config-2013.1b3Mark McLoughlin2013-02-176-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-134-8/+123
|/ | | | | | | | | | | | | | | 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>
* Merge "Support testing args for LocalhostMatchMaker."Jenkins2013-02-112-7/+9
|\
| * Support testing args for LocalhostMatchMaker.Eric Windisch2013-02-102-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The matchmaker should return the correct direct topics used by the RPC driver. The LocalhostMatchMaker was always returning 'localhost', even though our tests might use '127.0.0.1' instead. Now, the LocalhostMatchmaker will use whatever value it is told should be considered local. MatchMakerLocalhost and LocalhostExchange now take an optional host parameter. impl_zmq._get_matchmaker now passes arguments to the selected matchmaker module. The test_zmq now initializes the matchmaker, using the host '127.0.0.1' Change-Id: I8daa2c0668f1d717eb95ab56009612b8b60f0a15
* | Merge "Exchanges should return directed topics."Jenkins2013-02-081-3/+3
|\ \
| * | Exchanges should return directed topics.Eric Windisch2013-02-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exchanges in the matchmaker are supposed to return a directed topic as the first element in returned tuples. Adds a test to ensure this is so. Change-Id: I6c62f325914faa19216d5362c6d8ed0288942110
* | | Emit a warning if RPC calls made with lock.Michael Still2013-02-061-13/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will log a warning every time a RPC call is made while a lock is held if the caller has requested it. This should help us track down performance problems such as the security group refresh problem recently found in nova. RPC calls can emit a warning if called with check_for_lock=True and debugging is turned on. Sneaks up on bug 1063222. Change-Id: Ice94093efb3cb95dd58b31d6ba817c7d505c15af
* | | Merge "Mark password config options with secret"Jenkins2013-02-052-2/+4
|\ \ \
| * | | Mark password config options with secretMichael J Fork2013-02-042-2/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | 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
* | | Merge "Only unpack replies on caller."Jenkins2013-02-051-22/+18
|\ \ \
| * | | 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
|\