summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorHans Lindgren <hanlind@kth.se>2013-06-02 00:29:59 +0200
committerHans Lindgren <hanlind@kth.se>2013-06-04 14:09:52 +0200
commitcdf10381caad217ae9eb99c69a4226e40ba81db4 (patch)
tree279d3c0d8c6b5ef0e596e4ffe14a5d134718e7c4 /nova/compute
parent5a510518d9e3097730466cfbf4ff25495c4a0302 (diff)
Fix a race where a soft deleted instance might be removed by mistake
When a soft deleted instance is restored there is a tiny risk that it might be deleted if the reclaim periodic task runs at the same time. This happens because the restore operation sets deleted_at to None which makes the reclaim job think it is ok to delete the instance. This can be resolved by restricting reclaims to only those instances whose task_state is None. Resolves bug 1186243. Change-Id: Ia138e2d504b7482c46900583f019a32c70513245
Diffstat (limited to 'nova/compute')
-rwxr-xr-xnova/compute/manager.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index f9a1cc94d..be2f11ab6 100755
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -3989,6 +3989,7 @@ class ComputeManager(manager.SchedulerDependentManager):
return
filters = {'vm_state': vm_states.SOFT_DELETED,
+ 'task_state': None,
'host': self.host}
instances = self.conductor_api.instance_get_all_by_filters(context,
filters)