[ovs-git] [openvswitch/ovs] 303f5a: python: Send notifications after the transaction e...

otherwiseguy noreply at github.com
Mon Mar 15 16:29:10 UTC 2021


  Branch: refs/heads/branch-2.14
  Home:   https://github.com/openvswitch/ovs
  Commit: 303f5a76288075cc8cfcbdd5fcad70cfc1321bd2
      https://github.com/openvswitch/ovs/commit/303f5a76288075cc8cfcbdd5fcad70cfc1321bd2
  Author: Terry Wilson <twilson at redhat.com>
  Date:   2021-03-15 (Mon, 15 Mar 2021)

  Changed paths:
    M python/ovs/db/idl.py
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.py

  Log Message:
  -----------
  python: Send notifications after the transaction ends.

The Python IDL notification mechanism was sending a notification
for each processed update in a transaction as it was processed.
This causes issues with multi-row changes that contain references
to each other.

For example, if a Logical_Router_Port is created along with a
Gateway_Chassis, and the LRP.gateway_chassis set to that GC, then
when the notify() passes the CREATE event for the LRP, the GC will
not yet have been processed, so __getattr__ when _uuid_to_row fails
to find the GC, will return the default value for LRP.gateway_chassis
which is [].

This patch has the process_update methods return the notifications
that would be produced when a row changes, so they can be queued
and sent after all rows have been processed.

Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook")
Signed-off-by: Terry Wilson <twilson at redhat.com>
Acked-by: Brian Haley <haleyb.dev at gmail.com>
Acked-by: Dumitru Ceara <dceara at redhat.com>
Tested-by: Flavio Fernandes <flavio at flaviof.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list