[openstack-dev] [oslo] ordering of notification 'events' in oslo.messaging

Sandy Walsh sandy.walsh at rackspace.com
Mon Mar 31 14:36:13 UTC 2014


On 03/31/2014 10:55 AM, Gordon Sim wrote:
> I believe that ordering of notifications at different levels is not
> guaranteed when receiving those notifications using a notification
> listener in olso.messaging.
> 
> I.e. with something like:
> 
>     notifier = notifier.Notifier(get_transport(CONF), 'compute')
>     notifier.info(ctxt, event_type, payload_1)
>     notifier.warn(ctxt, event_type, payload_2)
> 
> its possible that payload_1 is received after payload_2. The root cause
> is that a different queue is used for events of each level.
> 
> In practice this is easier to observe with rabbit than qpid, as the qpid
> driver send every message synchronously which reduces the likelihood of
> there being more than one message on the listeners queues from the same
> notifier. Even for rabbit it takes a couple of thousand events before it
> usually occurs. Load on either the receiving client or the broker could
> increase the likelihood of out of order deliveries.
> 
> Not sure if this is intended, but as it isn't immediately obvious, I
> thought it would be worth a note to the list.

If they're on different queues, the order they appear depends on the
consumer(s). It's not really an oslo.messaging issue.

You can do reproduce it with just two events:
warn.publish("Foo")
info.publish("Blah")
consume from info
consume from warn
info is out of order.

And, it's going to happen anyway if we get into a timeout and requeue()
scenario.

I think we have to assume that ordering cannot be guaranteed and it's
the consumers responsibility to handle it.

-S



> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list