]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix AttributeError on port_bound for missing ports
authorarmando-migliaccio <armamig@gmail.com>
Wed, 14 Oct 2015 21:27:09 +0000 (14:27 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Fri, 16 Oct 2015 20:10:56 +0000 (13:10 -0700)
commita8d20e05079903a3fb2e952b7ec2c4cf27b208e9
tree4c5663ea4fada57dbc4b99babe4e4a5ad158901e
parent201ae16eec2964d56cda4cc6ab059ebbd1a422d0
Fix AttributeError on port_bound for missing ports

If the port is concurrently deleted, db_get_val returns None, and
that causes the Exception to be raised. However, the exception is just
log noise if the port has been deleted concurrently and it does not
lead to failures.

This can happen if port_update and port_delete operations occur
in short sequence and interleave. To prevent this trace from
occurring, this patch checks that the port is being eliminated and
emits an error trace only if the port is indeed to be expected
amongst the list of ports to be updated.

We do not raise an exception to avoid disrupting the agent sync
process, and leave to the admin the investigation of the issue
(should that be cronic rather than transient).

Under normal circumstances, if the port is expected it should
be there, and if it isn't this should be treated as a bug to be
investigated further.

Closes-bug: #1455320

Change-Id: Ic609af0ef6a09b536c882c58c23167c0a469b155
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py