From d94f22dc7a24ec8f769a4fbbffeb1b34780bbf3d Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 7 Mar 2012 02:10:18 +0000 Subject: Ignore InstanceNotFound when trying to set instance to ERROR Fixes bug 948632 There's a race condition where an instance can be deleted from an API call... immediately before some other error occurs during build. Also: compute tests should not test raising quantum exceptions, as those could never possibly make it back to us. rpc.call only raises RemoteError... so use that instead. Change-Id: Iacfe511a37e937eaec1d6213bf73153aa4d4e9bf --- nova/compute/manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 3d27d94cc..4b640b6ef 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -216,9 +216,13 @@ class ComputeManager(manager.SchedulerDependentManager): return self.db.instance_update(context, instance_id, kwargs) def _set_instance_error_state(self, context, instance_uuid): - self._instance_update(context, - instance_uuid, - vm_state=vm_states.ERROR) + try: + self._instance_update(context, + instance_uuid, vm_state=vm_states.ERROR) + except exception.InstanceNotFound: + LOG.debug(_("Instance %(instance_uuid)s has been destroyed " + "from under us while trying to set it to ERROR") % + locals()) def init_host(self): """Initialization for a standalone compute service.""" -- cgit