[oslo][nova] Revert of oslo.messaging JSON serialization change
balazs.gibizer at est.tech
Tue Oct 1 08:19:45 UTC 2019
On Mon, Sep 30, 2019 at 5:35 PM, Balázs Gibizer
<balazs.gibizer at est.tech> wrote:
> On Mon, Sep 30, 2019 at 4:45 PM, Ben Nemec <openstack at nemebean.com>
>> I've just proposed https://review.opendev.org/#/c/685724/ which
>> reverts a change that recently went in to make the fake driver in
>> oslo.messaging use jsonutils for message serialization instead of
>> As explained in the commit message on the revert, this is
>> because the rabbit driver uses kombu's default serialization method,
>> which is json.dumps. By changing the fake driver to use jsonutils
>> we've made it more lenient than the most used real driver which
>> us up to merging broken changes in consumers of oslo.messaging.
>> We did have some discussion of whether we should try to override the
>> kombu default and tell it to use jsonutils too, as a number of other
>> drivers do. The concern with this was that the jsonutils handler for
>> things like datetime objects is not tz-aware, which means if you
>> a datetime object over RPC and don't explicitly handle it you could
>> lose important information.
>> I'm open to being persuaded otherwise, but at the moment I'm leaning
>> toward less magic happening at the RPC layer and requiring projects
>> to explicitly handle types that aren't serializable by the standard
>> library json module. If you have a different preference, please
>> it here.
> I might me totally wrong here and please help me understand how the
> RabbitDriver works. What I did when I created the original patch that
> looked at each drivers how they handle sending messages. The
> oslo_messaging._drivers.base.BaseDriver defines the interface with a
> send() message. The oslo_messaging._drivers.amqpdriver.AMQPDriverBase
> implements the BaseDriver interface's send() method to call _send().
> Then _send() calls rpc_commom.serialize_msg which then calls
> The oslo_messaging._drivers.impl_rabbit.RabbitDriver driver inherits
> from AMQPDriverBase and does not override send() or _send() so I think
> the AMQPDriverBase ._send() is called that therefore jsonutils is used
> during sending a message with RabbitDriver.
I did some tracing in devstack to prove my point. See the result in
More information about the openstack-discuss