Fix cancellation uncordons, ASG event IDs and load balancer label removal #1291
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 303 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.342
Real PR Conversation Timeline
1 comments
"Review active on #1291"
general
weight: 0.35
micahhausler
Issue #, if available: N/A
Description of changes:
A cancelled scheduled event now uncordons the node once, and only when NTH acted on the event.
The ASG target lifecycle monitor reports one event per node instead of a new one on every poll, and NTH removes its own
exclude-from-external-load-balancerslabel.IMDS reports a cancelled scheduled event on every poll, and each report uncordoned the node, undoing an administrator's cordon.
A cancellation now uncordons the node only when NTH acted on the event: the event is in the event store, or, after NTH restarts, the node carries the
aws-node-termination-handler/event-idlabel for it.NTH now sets that label for every IMDS scheduled event, not only reboot events, so a cancelled stop or retirement event still uncordons the node after a restart.
It does not uncordon while another event for the node is active.
The event ID hashed
time.Now(), so every poll created a new event.It now hashes the state and node name.
removeLabelIfValueMatcheshad its check inverted.TestMonitor_Successfor the ASG lifecycle monitor could never fail.It served the
InServicestate, which the monitor ignores.It now serves
Terminated, with new tests thatInServicesends no event and that the event ID is stable across polls.It read the tagged instance gauge once, at about the moment NTH first computes it.
It now retries until the counters and the gauge have their expected values.
How you tested your changes:
Environment (Linux / Windows): Linux
Kubernetes Version: N/A (unit tests with the fake clientset)
go test ./...andgo vet ./...pass.shellcheck -S warning, and its value parsing and exit codes were checked against sample metrics output.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.