Skip to content

Commit

Permalink
fix: add another loop to keep waiting til fully in standby, helps wit…
Browse files Browse the repository at this point in the history
…h enteringStandby
  • Loading branch information
sesheffield committed Sep 23, 2024
1 parent cf12137 commit d619f41
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/scripts/put-all-chain-nodes-on-standby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ do
--instance-ids "$chain_node_instance_id" \
--auto-scaling-group-name "$autoscaling_group_name" \
--should-decrement-desired-capacity

while true; do
autoscaling_group_state=$(aws autoscaling describe-auto-scaling-instances --instance-ids "$chain_node_instance_id" | jq -r '[.AutoScalingInstances | .[].LifecycleState] | join(" ")')
if [ "$autoscaling_group_state" == "Standby" ]; then
echo "instance ($chain_node_instance_id) is now in standby state"
break
else
echo "instance ($chain_node_instance_id) not in standby state yet (current state: $autoscaling_group_state), waiting 10 seconds"
sleep 10
fi
done
;;
*)
echo "instance ($chain_node_instance_id) not in an elgible state ($autoscaling_group_state) for going on standby, skipping"
Expand Down

0 comments on commit d619f41

Please sign in to comment.