[openstack-dev] [Oslo] Does ZeroMQ RPCs handle caller side exceptions correctly?
Eric Windisch
eric at cloudscaling.com
Sun Jan 27 17:44:05 UTC 2013
On Sunday, January 27, 2013 at 12:06 PM, Ray Pekowski wrote:
> I have not had a chance to configure a ZeroMQ setup with OpenStack, but have been getting a pretty good understanding of the RPC component from my work on https://blueprints.launchpad.net/oslo/+spec/amqp-rpc-fast-reply-queue. The code review investigations led me to check how the ZeroMQ RPC implementation handles certain error paths. What I think I discovered is that the ZeroMQ RPC implementation handles caller side exceptions by simply call stack dumping the thread. Nothing is logged, nothing is returned in an RPC call response. Is this correct? Should this be logged as a bug? A simply try/catch around proxy.dispatch() like in amqp.py would be the fix.
>
As I understand it, yes. If a remote exception is found, raise it. If there is a fatal local exception, raise RPCException. The entirety of impl_zmq's public methods do not simply wrap everything in try/except block, so it is possible that there could be an uncaught exception betsides RemoteError or RPCException that gets raised. My understanding of the amqp-based drivers is that their code behaves similarly in all regards.
Checking, the only method invoked by impl_zmq.call() that seems likely to raise an exception that isn't currently caught is _deserialize() which wraps jsonutils.dumps(). This could be caught and made to raise RPCException. All the other methods invoked by impl_zmq.call() seem to either raise zmq.ZMQError (which is caught and reraised as RPCException) or directly raise RPCException.
If you believe there is a bug or misbehavior in the zeromq driver, I'll very happily persue and resolve it.
Regards,
Eric Windisch
More information about the OpenStack-dev
mailing list