summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2022-06-23 11:04:20 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2022-06-23 11:04:20 -0700
commitd75424b5e5685a9cf04b30a5b0555efd1313e9c3 (patch)
tree054b6199fc269bbb8bff6665ef9061f8a178c4b6 /ironic/drivers/modules
parent1b6114934c122df115b8c945ca1ce8c3b7bd9bfd (diff)
downloadironic-d75424b5e5685a9cf04b30a5b0555efd1313e9c3.tar.gz
Prevent pxe retry when agent token exists
A race condition can be observed in CI under heavy load where the conductor triggers are boot of the agent before it is fully online based upon state, but not considering the existence of an agent token. As a result, agent is never able to check in with Ironic and the overall operation fails. We now consider agent token's existence before retrying PXE as it is the very earliest indicator of a starting agent. Change-Id: Ice764866a08647031d16570860ec384204269501 Story: 2010107 Task: 45674
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r--ironic/drivers/modules/pxe_base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ironic/drivers/modules/pxe_base.py b/ironic/drivers/modules/pxe_base.py
index 317b65b85..78d7b5987 100644
--- a/ironic/drivers/modules/pxe_base.py
+++ b/ironic/drivers/modules/pxe_base.py
@@ -490,6 +490,12 @@ class PXEBaseMixin(object):
def _should_retry_boot(node):
# NOTE(dtantsur): this assumes IPA, do we need to make it generic?
for field in ('agent_last_heartbeat', 'last_power_state_change'):
+ if node.driver_internal_info.get('agent_secret_token', False):
+ LOG.debug('Not retrying PXE boot for node %(node)s; an agent '
+ 'token has been identified, meaning the agent '
+ 'has started.',
+ {'node': node.uuid})
+ return False
if manager_utils.value_within_timeout(
node.driver_internal_info.get(field),
CONF.pxe.boot_retry_timeout):