Repository navigation
Fix dynamic nodes stuck in COMPLETING after their instance is terminated and there is a new instance reusing the same IP - #752
Merged
Conversation
hanwen-cluster
force-pushed
the
develop
branch
from
October 23, 2026 17:56
848707a to
be446d4
Compare
…ted and there is a new instance reusing the same IP Source: github.com/aws/aws-parallelcluster/issues/7671 ### Summary A dynamic node that still has a job can get stuck as `IDLE+CLOUD+COMPLETING+POWER_DOWN` after clustermgtd terminates its EC2 instance. The job never finishes completing, the node is never powered down, and clustermgtd takes no further action. ### Root cause 1. clustermgtd finds the node unhealthy, terminates its instance and runs `scontrol update state=power_down_force`, which also resets NodeAddr to the node name. 2. `POWER_DOWN_FORCE` kills the job but leaves the node's base state alone. Slurm still treats the node as reachable and waits for `EPILOG_COMPLETE`. `SuspendProgram` doesn't run while the node is COMPLETING. 3. Normally slurmd stops answering, and after `SlurmdTimeout` Slurm marks the node DOWN and recovers it. But if EC2 gives the old private IP to another compute node, that node's slurmd answers in its place. So the node keeps looking alive, and the epilog never completes. 4. clustermgtd never notices. It decides whether a node should have an instance from NodeAddr, and NodeAddr has already been reset. Slurm still holds the old InstanceId, because it only clears InstanceId at POWERED_DOWN. Change Add SlurmNode.is_instance_expected() and use it in is_backing_instance_valid(). A node is now expected to have an instance if NodeAddr is set, or if InstanceId is set and the node isn't powering down or powered down. Slurm keeps InstanceId until POWERED_DOWN, so a stuck node is now reported as missing its instance. clustermgtd then treats it as unhealthy and sends another power_down_force. For a job that is already completing, that clears the node's epilog wait (kill_running_job_by_node_ptr), so the jobs are requeued and the node powers down. Scope - Detection logic only; the scontrol commands clustermgtd sends are unchanged. - We considered setting nodes `DOWN` before power_down_force, which releases jobs immediately. It's deferred because it changes behavior for every power-down caller.
hanwen-cluster
force-pushed
the
develop
branch
from
October 23, 2026 18:08
be446d4 to
d16f2b9
Compare
hgreebe
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source: github.com/aws/aws-parallelcluster#7671
Summary
A dynamic node that still has a job can get stuck as
IDLE+CLOUD+COMPLETING+POWER_DOWNafter clustermgtd terminates its EC2 instance. The job never finishes completing, the node is never powered down, and clustermgtd takes no further action.Root cause
scontrol update state=power_down_force, which also resets NodeAddr to the node name.POWER_DOWN_FORCEkills the job but leaves the node's base state alone. Slurm still treats the node as reachable and waits forEPILOG_COMPLETE.SuspendProgramdoesn't run while the node is COMPLETING.SlurmdTimeoutSlurm marks the node DOWN and recovers it. But if EC2 gives the old private IP to another compute node, that node's slurmd answers in its place. So the node keeps looking alive, and the epilog never completes.Change
Add SlurmNode.is_instance_expected() and use it in is_backing_instance_valid(). A node is now expected to have an instance if NodeAddr is set, or if InstanceId is set and the node isn't powering down or powered down. Slurm keeps InstanceId until POWERED_DOWN, so a stuck node is now reported as missing its instance. clustermgtd then treats it as unhealthy and sends another power_down_force. For a job that is already completing, that clears the node's epilog wait (kill_running_job_by_node_ptr), so the jobs are requeued and the node powers down.
In other words,
InstanceIdis only cleared by Slurm, whileNodeAddrcan be cleared by both clustermgtd and Slurm. If clustermgtd clearsNodeAddrearly, we are ignoring nodes inCOMPLETINGstate. By relying onInstanceId, we coverCOMPLETINGstate too.Scope
DOWNbefore power_down_force, which releases jobs immediately. It's deferred because it changes behavior for every power-down caller.NodeAddr, and only rely on Slurm resettingNodeAddruponPOWERED_DOWN, but that increases the risk of IP reuse, and may have uninvestigated changes to cluster scalingTests
References
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.