From bcd15401175036404dc3467918612c7c902d79d1 Mon Sep 17 00:00:00 2001 From: Simon Westphahl Date: Wed, 9 Oct 2024 10:57:11 +0200 Subject: [PATCH] Check node is unallocated before max-ready clean Besides the state we also need to check whether a node is still unallocated before marking it as deleting during max-ready age cleanup. Change-Id: Idd369ce2c5a6f41bfe2986544b5e138399b57a2e --- nodepool/launcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodepool/launcher.py b/nodepool/launcher.py index f91b1f6db..7a8faf2e9 100644 --- a/nodepool/launcher.py +++ b/nodepool/launcher.py @@ -759,7 +759,7 @@ class CleanupWorker(BaseCleanupWorker): # Double check the state now that we have a lock since it # may have changed on us. - if node.state != zk.READY: + if node.state != zk.READY or node.allocated_to: zk_conn.unlockNode(node) continue