Merge "Don't delete_port on binding deadlock"

This commit is contained in:
Jenkins 2017-02-21 08:26:30 +00:00 committed by Gerrit Code Review
commit f3287313d8

View File

@ -346,6 +346,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
self._update_port_dict_binding(port, binding)
return changes
@db_api.retry_db_errors
def _bind_port_if_needed(self, context, allow_notify=False,
need_notify=False):
for count in range(1, MAX_BIND_TRIES + 1):
@ -1302,13 +1303,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
try:
bound_context = self._bind_port_if_needed(mech_context)
except os_db_exception.DBDeadlock:
# bind port can deadlock in normal operation so we just cleanup
# the port and let the API retry
with excutils.save_and_reraise_exception():
LOG.debug("_bind_port_if_needed deadlock, deleting port %s",
result['id'])
self.delete_port(context, result['id'])
except ml2_exc.MechanismDriverError:
with excutils.save_and_reraise_exception():
LOG.error(_LE("_bind_port_if_needed "