]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Avoid notifying while inside transaction opened in delete_port()
authorIhar Hrachyshka <ihrachys@redhat.com>
Wed, 18 Jun 2014 14:56:25 +0000 (16:56 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Sat, 5 Jul 2014 13:55:18 +0000 (15:55 +0200)
commit876c2c25e15806529f4e197cd265bc3b2184aa14
treed85c1d5ad95ee203e602bd1ef724e6f4103628fc
parent6e877945c923857395de3b5fd15953c58a4d74a4
Avoid notifying while inside transaction opened in delete_port()

delete_port() calls to disassociate_floatingips() while in transaction.
The latter method sends RPC notification which may result in eventlet
yield. If yield switches a thread to another one that tries to access
the same floating IP object in db as disassociate_floatingips() method
does, we're locked and get db timeout.

We should avoid calling to notifier while under transaction.

To achieve this, I introduce a do_notify argument that controls whether
notification is done by disassociate_floatingips() itself or delegated
to caller. Callers that call to disassociate_floatingips() from under
transactions should handle notifications on their own. For this,
disassociate_floatingips() returns a set of routers that require
notification.

Updated drivers to reflect new behaviour. Added unit test.

Change-Id: I2411f2aa778ea088be416d062c4816c16f49d2bf
Closes-Bug: 1330955
14 files changed:
neutron/db/l3_db.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
neutron/plugins/embrane/base_plugin.py
neutron/plugins/linuxbridge/lb_neutron_plugin.py
neutron/plugins/ml2/plugin.py
neutron/plugins/mlnx/mlnx_plugin.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/nuage/plugin.py
neutron/plugins/oneconvergence/plugin.py
neutron/plugins/openvswitch/ovs_neutron_plugin.py
neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py
neutron/plugins/ryu/ryu_neutron_plugin.py
neutron/tests/unit/ml2/test_ml2_plugin.py