yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #44006
[Bug 1518848] Re: set reclaim_instance_interval < 0, never delete instance completely.
Reviewed: https://review.openstack.org/248539
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f3a2f8fc1048a70426b44e614790c2d8db431bbc
Submitter: Jenkins
Branch: master
commit f3a2f8fc1048a70426b44e614790c2d8db431bbc
Author: ChangBo Guo(gcb) <eric.guo@xxxxxxxxxxxx>
Date: Mon Nov 23 14:16:23 2015 +0800
Fix reclaim_instance_interval < 0 never delete instance completely
CONF.reclaim_instance_interval is interval in seconds for reclaiming
deleted instances. It should take effect only when value is greater
than 0. But current when set it with -1 for example, it will pass check
if we should soft delete an instance, but can't pass check whether should
clean soft deleted instance, then never have chance to clean up a soft deleted
instance and release the quota.
This commit sets CONF.reclaim_instance_interval's minimum value to 0.
Closes-Bug: #1518848
Change-Id: Idd8faad1a40f8898a9471504e664c3676b1b0e06
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1518848
Title:
set reclaim_instance_interval < 0, never delete instance completely.
Status in OpenStack Compute (nova):
Fix Released
Bug description:
CONF.reclaim_instance_interval is interval in seconds for reclaiming deleted instances. It should takes effect only when value is greater than 0. current if we set it with -1 for example . It will pass the check of ' if CONF.reclaim_instance_interval:' and do a soft_delete. See https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L752
def _delete(self, context, req, instance_uuid):
authorize(context, action='delete')
instance = self._get_server(context, req, instance_uuid)
if CONF.reclaim_instance_interval:
try:
self.compute_api.soft_delete(context, instance)
except exception.InstanceInvalidState:
# Note(yufang521247): instance which has never been active
# is not allowed to be soft_deleted. Thus we have to call
# delete() to clean up the instance.
self.compute_api.delete(context, instance)
else:
self.compute_api.delete(context, instance)
We do reclaim instance in https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L6192
def _reclaim_queued_deletes(self, context):
"""Reclaim instances that are queued for deletion."""
interval = CONF.reclaim_instance_interval
if interval <= 0:
LOG.debug("CONF.reclaim_instance_interval <= 0, skipping...")
return
That means we never have chance to clean up a soft deleted instance
and release the quota.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1518848/+subscriptions
References