Merge "Allow deleting instances while uuid lock is held"
This commit is contained in:
@@ -2018,7 +2018,7 @@ class ComputeManager(manager.Manager):
|
||||
def terminate_instance(self, context, instance, bdms, reservations):
|
||||
"""Terminate an instance on this host."""
|
||||
|
||||
@utils.synchronized(instance['uuid'])
|
||||
@utils.synchronized(instance['uuid'] + ".delete")
|
||||
def do_terminate_instance(instance, bdms):
|
||||
try:
|
||||
self._delete_instance(context, instance, bdms,
|
||||
|
||||
@@ -919,19 +919,17 @@ class NetworkManager(manager.Manager):
|
||||
|
||||
if CONF.force_dhcp_release:
|
||||
dev = self.driver.get_dev(network)
|
||||
# NOTE(vish): The below errors should never happen, but there
|
||||
# may be a race condition that is causing them per
|
||||
# https://code.launchpad.net/bugs/968457, so we log
|
||||
# an error to help track down the possible race.
|
||||
msg = _("Unable to release %s because vif doesn't exist.")
|
||||
|
||||
if not vif_id:
|
||||
LOG.error(msg % address)
|
||||
# NOTE(russellb) This will get hit if we're tearing down an
|
||||
# instance before it finished getting created. In that
|
||||
# case a vif may never have been associated with the
|
||||
# fixed_ip.
|
||||
return
|
||||
|
||||
vif = vif_obj.VirtualInterface.get_by_id(context, vif_id)
|
||||
|
||||
if not vif:
|
||||
LOG.error(msg % address)
|
||||
return
|
||||
|
||||
# NOTE(cfb): Call teardown before release_dhcp to ensure
|
||||
|
||||
Reference in New Issue
Block a user