[openstack-dev] [Oslo] RPC protocol violations

Russell Bryant rbryant at redhat.com
Mon Jan 28 19:57:40 UTC 2013


On 01/28/2013 02:48 PM, Eric Windisch wrote:
>> 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)

Yeah, something like that.  You're right that this is a bug in amqp.py,
it needs to be returning an exception.

-- 
Russell Bryant



More information about the OpenStack-dev mailing list