Remove terminated image/instance delete threads
When the separate image and instance delete threads were added for periodic cleanup of leaked images and instances, the same anti-duplication mechanism used for the periodic cleanup of nodes was used: an dictionary of thread objects keyed by the object being deleted. However, the cleanup of those delete threads was neglected, meaning that after those threads exited, if the object persisted, nodepool would never try to delete it again. This change adds the missing cleanup code. Change-Id: Iac4049d265e23a7eae1b2917181de3c35fb6359d
This commit is contained in:
parent
2cc9490901
commit
161792daa1
@ -2353,6 +2353,14 @@ class NodePool(threading.Thread):
|
||||
if not t.isAlive():
|
||||
del self._delete_threads[k]
|
||||
|
||||
for k, t in self._image_delete_threads.items()[:]:
|
||||
if not t.isAlive():
|
||||
del self._image_delete_threads[k]
|
||||
|
||||
for k, t in self._instance_delete_threads.items()[:]:
|
||||
if not t.isAlive():
|
||||
del self._instance_delete_threads[k]
|
||||
|
||||
node_ids = []
|
||||
image_ids = []
|
||||
dib_image_ids = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user