[openstack-dev] [Oslo] RPC protocol violations (was: ZeroMQ =?utf-8?Q?handle=E2=80=A6_?=exceptions correctly?)

Eric Windisch eric at cloudscaling.com
Mon Jan 28 19:48:24 UTC 2013


> 31: LOG.error(_("RPC message did not include method."))
> Why not handle it like AMQP and at least return something. Plus the gain would be some consistency. Here is what AMQP does:
> if not method:
> LOG.warn(_('no method for message: %s') % message_data)
> ctxt.reply(_('No method for message: %s') % message_data,
> connection_pool=self.connection_pool)
> return


I began looking to do as you suggest and realized the amqp implemenation might be doing this wrong, too?

Isn't this just returning the error as a string back to the caller? What if the method the caller was seeking was returning a string already? What if it was expecting some OTHER data type? Shouldn't this create, serialize, and send an Exception?

Perhaps something as simple as the following?

ctxt.reply(failure=RPCException(_('No method for message: %s') % message_data)

Regards,
Eric Windisch




More information about the OpenStack-dev mailing list