From 08beabc5e0fc3fffc074a634040f5821d4d1d5f2 Mon Sep 17 00:00:00 2001 From: Stanislaw Pitucha Date: Wed, 6 Nov 2013 14:15:51 +0000 Subject: [PATCH] Allow deleting instances while uuid lock is held Avoid issues where locked up operations on the instance prevent it from being deleted by the user. Reasons for the lock up are a separate issue and will be handled elsewhere, but terminating the instance should not affect any tasks anyway. Any modification should already gracefully handle the instance going away. For more discussion about the issue see: http://lists.openstack.org/pipermail/openstack-dev/2013-October/017454.html This patch was merged once before and had to be reverted in 6b7304d8d38c0f04643bdcd031d682c688c91b28. It was causing an extremely large number of errors in gate jobs. I believe that the case being hit should be expected with this patch in place, and that it's actually OK. We expect that the rest of the code will handle this case gracefully. Simply remove this error message from the code. Change-Id: I83deae464518fef5abe8fc00bfd0a186de01527b Partial-Bug: #1248563 Co-authored-by: Russell Bryant --- nova/compute/manager.py | 2 +- nova/network/manager.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index f315180983..b84840dccd 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2025,7 +2025,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, diff --git a/nova/network/manager.py b/nova/network/manager.py index fd8ff47be8..a59599d361 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -916,19 +916,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