summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
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
* Merge "Don't reconnect to exclusive fanout consumers."Jenkins2013-06-261-1/+24
|\
| * Don't reconnect to exclusive fanout consumers.Michael Wilson2013-06-121-1/+24
| | | | | | | | | | | | | | | | See bug #1180166, basically we shouldn't be trying to reconnect to exclusive queues. Fixes: bug #1180166 Change-Id: I71ac5a150ea8c4d97a34404cb821ce8e8dfa152d
* | Merge "Make AMQP based RPC consumer threads more robust"Jenkins2013-06-262-0/+4
|\ \
| * | Make AMQP based RPC consumer threads more robustRaymond Pekowski2013-06-252-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | rpc: remove some unused serialization codeMark McLoughlin2013-06-251-6/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first commit of Nova contains this code as https://github.com/openstack/nova/blob/bf6e6e7/nova/rpc.py#L149 try: publisher.send({'result': reply}) except TypeError: publisher.send( {'result': dict((k, repr(v)) for k, v in reply.__dict__.iteritems()) }) but when the kombu driver was first added, it became: https://github.com/openstack/nova/blob/9cb46c48/nova/rpc/impl_kombu.py#L717 try: msg = {'result': reply, 'failure': failure} except TypeError: msg = {'result': dict((k, repr(v)) for k, v in reply.__dict__.iteritems()), 'failure': failure} conn.direct_send(msg_id, msg) Obviously, TypeError can't be raised with the current code and we dump everything to json these days before passing down to kombu, qpid, etc. Change-Id: I932fbfbbe824fbd9de8d31f070878e9db853ee45
* | Merge "Optionally reject messages on exception."Jenkins2013-06-243-16/+44
|\ \
| * | Optionally reject messages on exception.Sandy Walsh2013-06-203-16/+44
| |/ | | | | | | | | | | | | | | | | 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
* / Remove unused zmq relay functionalityMark McLoughlin2013-06-171-26/+3
|/ | | | | | | | | | Fixes bug #1188029 This relay functionality appears to be completely unused and untested so just remove it. If we need it in future, we can restore it from the git history. Change-Id: I479d654aefdbd58c80946818b9a405eaa02644db
* Allow exceptions to hop up cellsMatthew Sherborne2013-06-121-3/+15
| | | | | | | | | | | | | | | | | | When an exception happens in an RPC call using nova cells, it can travel back up several RPC boundaries. eg, child-cell=>parent-cell=>nova-api Before this patch if an exception (eg. AggregateNotFound) was raised in the bottom layer, the next layer up would turn it into a special exception ( AggregateNotFound_Remote ), then in the final layer, it would see this as an unrecognizable exception and raise RemoteException. After this patch, at each layer where the expeption is deserialized, it'll recognize exceptions with the _Remote postfix, and leave them as they are, instead of turning them into RemoteExceptions. It also preserves the exception's original __module__ now. Change-Id: I158a80f1cec20d3e1805b565ffddaffd7a15295b
* Merge "Remove the amqp_rpc_single_reply_queue option from Havana"Jenkins2013-06-111-91/+9
|\
| * Remove the amqp_rpc_single_reply_queue option from HavanaRaymond Pekowski2013-06-051-91/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | blueprint amqp-rpc-fast-reply-queue As part of the Grizzly code review for the above blueprint (Idb09a714), the Grizzly code base is "aware" of this feature in terms of receiving RPCs and provided with an option for enabling it on the RPC send side. It was decided that in Havana the option would be removed, RPCs would only be sent using the new functionality yet awareness of prior functionality be retained for the receiving of RPCs. This code change implements the Havana piece. Change-Id: I5f2a8e432cf84a637c1aa813656c1cbc8db6e7eb
* | Merge "zmq: remove someone unused code from ZmqClient"Jenkins2013-06-111-5/+3
|\ \
| * | zmq: remove someone unused code from ZmqClientMark McLoughlin2013-06-061-5/+3
| |/ | | | | | | | | | | | | | | The socket_type and bind constructor args are never used. We always supply a value for the envelope argument. Change-Id: Ide2e11170a3415ef347f85bfcce759cdd55d1225
* | Merge "Add can_send_version() to RpcProxy."Jenkins2013-06-111-0/+5
|\ \
| * | Add can_send_version() to RpcProxy.Russell Bryant2013-06-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add a helper method to the RpcProxy class. This is a little nicer to use for checking to see if a given message is copmatible with the set version cap. Change-Id: Ic44d76f4181351dff367f2d1181a3d508a11db78
* | | Enable hacking H404 test.Dina Belova2013-06-116-133/+106
|/ / | | | | | | | | | | H404 - multi line docstring should start with a summary. Change-Id: I2099e1ee81ff9657f7a07401b8e8f3327d03bdbd
* | Merge "MatchMakerStub - make it work & add test"Jenkins2013-06-111-1/+1
|\ \ | |/ |/|
| * MatchMakerStub - make it work & add testEric Windisch2013-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | The super() in MatchMakerStub.__init__ was referencing the wrong class due to copy/paste. I've also added a test for this class. Fixes bug 1185501 Change-Id: I298c8c1df4dcb3d3e905ecbb5400d16b3383fdf9
* | Fix problem with long messages in QpidBen Nemec2013-06-031-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | Qpid has a limitation where it cannot serialize a dict containing a string greater than 65535 characters. This change alters the Qpid implementation to JSON encode the dict before sending it, but only if Qpid would fail to serialize it. This maintains as much backward compatibility as possible, though long messages will still fail if they are sent to an older receiver. Fixes bug 1175808 Change-Id: I5d104e099f523508dae2b657f7d06d96984b10f0
* | Enable hacking H402 testSergey Lukjanov2013-06-036-67/+67
| | | | | | | | | | | | H402 one line docstring needs punctuation Change-Id: Ie848453cace318d8310cdf0234c512f4c1121119
* | Silence exceptions from qpid connection.close()David Ripton2013-05-311-1/+7
| | | | | | | | | | | | | | | | | | | | | | Fixes bug 1185465 Don't log exceptions that happen during connection.close(). They're not surprising (a closed socket can't be read or written), don't require sysadmin attention, and provide red herrings in the logs to distract from finding real root causes of problems. Change-Id: Ie414ba3f4ff1f1dee13e6168ac2e28dab535581b
* | Merge "Use zero-copy in ZeroMQ proxy (zmq-rpc-receiver)"Jenkins2013-05-311-14/+7
|\ \
| * | Use zero-copy in ZeroMQ proxy (zmq-rpc-receiver)Eric Windisch2013-05-231-14/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | Now, messages will not be copied into the Python memory space from the C library. The 'topic' key *will* be copied, to make use of several string/bytes functions that are available to us. (Potentially, we might be able to work with this as a memoryview in the future as a further optimization?) Implements blueprint zmq-zero-copy Change-Id: I20a700867ac642b1a1788b31e3a21f8a299c97c8
* | Merge "Enable hacking H403 test"Jenkins2013-05-303-5/+9
|\ \
| * | Enable hacking H403 testSergey Lukjanov2013-05-303-5/+9
| | | | | | | | | | | | | | | | | | H403 multi line docstring end on new line Change-Id: I33249651026b54ef346214965e909835288bb14e
* | | Merge "Enable hacking H401 test"Jenkins2013-05-301-1/+1
|\| |
| * | Enable hacking H401 testSergey Lukjanov2013-05-301-1/+1
| |/ | | | | | | | | | | H401 docstring should not start with a space Change-Id: I761665ea9aff1f55de9f629ff8d108ba141eaf79
* / Remove rootwrap from IPC directory creationEric Windisch2013-05-231-11/+10
|/ | | | | | | | | | | | | | | | | | Removes processutils/rootwrap dependency. Fixes bug 1160420 and partially fixes 1180631. The attempt will still be made to create /var/run/openstack, but will give a reasonable error when it happens. If the directory exists, but permissions are denied, we should also give a reasonable error. A patch will be submitted to devstack that will set and create the IPC directory as necessary. Packagers should do this as well. Change-Id: I7814320adbfd0b2fe54cc2e523452c18ab2e7687
* Merge "Enable hacking H702 localization test"Jenkins2013-05-211-1/+2
|\
| * Enable hacking H702 localization testJoe Gordon2013-05-201-1/+2
| | | | | | | | | | | | | | Fix and enable test for 'formatting operation should be outside of localization method call' Change-Id: I0e707f9d4aacf75f9a9239b323a57d7d39f30c84
* | Merge "Enable hacking H703: Multiple positional placeholders"Jenkins2013-05-211-2/+3
|\|
| * Enable hacking H703: Multiple positional placeholdersJoe Gordon2013-05-201-2/+3
| | | | | | | | | | | | | | Fix and enable test for multiple positional placeholders in localizations Change-Id: Ie3b5e3113cd0f3340b7b0f5774001893b1e6857c
* | Add generic serialization supportDan Smith2013-05-213-5/+113
| | | | | | | | | | | | | | | | | | | | | | | | This adds a generic serialization model that the RpcProxy and RpcDispatcher will use to serialize and deserialize arguments and return values. The base definition is provided, as well as a default NoOpSerializer which performs no special action (retaining the existing behavior). Related to blueprint rpc-object-serialization Change-Id: I0a33baddee3e28dfc47100eb3216b679558b0bdd
* | Allow RPC_API_NAMESPACE on RpcProxy objectsChris Behrens2013-05-201-3/+6
| | | | | | | | | | | | | | | | | | | | This allows one to subclass RpcProxy for use with a particular namespace without having to repeatedly pass the namespace into the make_namespaced_msg() method. This new RPC_API_NAMESPACE attribute will be used for the make_msg() call. It is defaulted to None to match previous behavior. Change-Id: Ied62df839cda0be6f9f9b060bbfc22e086f61be8
* | Merge "Extract matchmaker_ring to own module"Jenkins2013-05-173-80/+121
|\ \
| * | Extract matchmaker_ring to own moduleEric Windisch2013-05-153-80/+121
| |/ | | | | | | | | | | | | | | | | | | | | The base matchmaker module should not have all the matchmakers implemented within. Instead, we desire to break them out. For purposes of deprecation, logs a warning when importing from the ZeroMQ driver. Change-Id: I76936edd97309621a9c28363dccd792293a1c0d3
* / Support capping message versions in the client.Russell Bryant2013-05-152-3/+15
|/ | | | | | | | | | | | | | | | | | | When doing a rolling upgrade, we need to be able to tell all rpc clients to hold off on sending newer versions of messages until all nodes understand the new message version. This patch adds the oslo component of this. It's quite simple. The rpc proxy just stores the version cap and will raise an exception if code ever tries to send a message that exceeds this cap. Allowing the cap to be configured and generating different types of messages based on the configured value is the hard part here, but that is left up to the project using the rpc library. Implements blueprint rpc-version-control. Change-Id: Ia69db03a80dc3b1c63d52c7e163ea3cfec80c882
* Merge "Removes len() on empty sequence evaluation"Jenkins2013-05-132-3/+3
|\
| * Removes len() on empty sequence evaluationZhongyue Luo2013-05-132-3/+3
| | | | | | | | | | | | PEP8 suggestes, "For sequences, use the fact that empty sequences are false." Change-Id: I4c600a7a6230a55328ee46f7c59f340f37abc18f
* | Merge "python3: use 'as' syntax for exception assignment"Jenkins2013-05-131-1/+1
|\ \ | |/ |/|
| * python3: use 'as' syntax for exception assignmentChuck Short2013-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | From http://docs.python.org/3.1/whatsnew/3.0.html The except exc as var syntax is now standard and except exc, var is no longer supported. Change-Id: Ia3a11d72c474806cc2303a7fc9cb1a390266c0fb Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Convert unicode for python3 portabilityChuck Short2013-05-061-2/+4
|/ | | | | | | | | | | | | From http://docs.python.org/3.1/whatsnew/3.0.html: "Python 3.0 uses the concepts of text and (binary) data instead of Unicode strings and 8-bit strings." Use six.text_type to Type for representing (Unicode) textual data. This is unicode() in Python 2 and str in Python 3. Change-Id: I3da268a714a34a8e626a2590f01b86e414dc3411 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Ensure that qpid connection is closed.Gary Kotton2013-05-011-6/+7
| | | | | | | | | Fixes bug 1172922 When reestablishing a session and a connection already exists the existing connection will be closed prior to opening the new one. Change-Id: I9a25800fe4b56eba89d550e3461ce095bf902f0a
* Improve Python 3.x compatibilityDirk Mueller2013-04-224-8/+8
| | | | | | | Mechanical translation of deprecated constructs to 3.x compatible variants. Change-Id: I4988d0ac656903e0d0320aaa8361d4eeb774a0f9
* Merge "Replaces standard logging with common logging"Jenkins2013-04-201-1/+1
|\
| * Replaces standard logging with common loggingZhongyue Luo2013-04-091-1/+1
| | | | | | | | | | | | | | Common modules can now safely import other common modules since update.py will automatically install dependencies. Change-Id: I0ad12d7e6e623657c40659aca4148439cd03d3fa
* | Add rpc method namespace support.Russell Bryant2013-04-125-14/+41
|/ | | | | | | | | | | | | | | | | | | | | | RPC endpoints already had the ability to expose multiple APIs ... sort of. You could pass multiple callback objects to the dispatcher and it would check all of them for a method call. This patch adds the ability to set a namespace on a callback object. This makes exposing multiple APIs a bit more like you would expect it to work. You can invoke a method on a specific callback object, as opposed to having it check all of them for the method. This will allow you to create, manage, and version APIs without any potential conflicts with other APIs being exposed by the same endpoint. An example of where I would like to use this is in Nova, where we have some methods that we would like to expose on *all* rpc endpoints. This includes no public API changes and is fully backwards compatible. Implement blueprint rpc-multi-api. Change-Id: Ief4433e2e1c32cfb05b4cd27b87fe32b40f4341d