fix(fault-quarantine): do not trip on a deleted node when no GPU nodes are counted #2383
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2383"
general
weight: 0.35
blacksoxx
Summary
The breaker kept a deleted node's cordon in its window. Replacing a quarantined node is normal remediation, so on a small or autoscaled GPU fleet the departed node's cordon tripped the breaker: right away when no GPU nodes were left, or at the next check after GPU nodes scaled back up inside the window.
Fixes #2382
isTrippedByRecentCordons: checks each node cordoned in the window withNodeExists, read from the node informer cache, and trips only if one is still in the cluster. That node existing with zero GPU nodes counted is what showsgpuNodeLabeldoes not match. It does not use the quarantine index because the annotation reaches the index only when the patched node's watch event arrives. If the lookup fails, it returns the error without tripping, the same as the standing bound.ForgetDeletedNodes: when a delete takes the GPU node count to zero, the breaker drops the cordon of every node in the window that is no longer in the cluster. The node informer's GPU counter calls it, so it runs whether or not the last node was quarantined, and it sees deletes and adds in the order they happened: a replacement that joins before the last delete keeps the count above zero. While any GPU node remains, a deleted node keeps counting toward the rate bound, so remediation that replaces nodes, likeREPLACE_VM, still trips it. Nodes that still exist keep their cordons for thegpuNodeLabelcheck.gpuNodeLabel, the breaker trips only if a cordoned node is still in the cluster at the next check. If cordoned nodes are terminated before then, cordons are not stopped one by one. The breaker targets bursts, and a burst leaves cordoned nodes behind.ForgetDeletedNodeskeeps only the nodes that still exist. Envtests through the reconciler: deleting the last quarantined GPU node, deleting two quarantined nodes one after the other, and deleting a healthy last GPU node after a quarantined one all leave the replacement CLOSED; deleting one of two cordoned nodes while a third GPU node remains keeps its cordon and trips at 100%. The e2e setup registers callbacks withSetupNodeInformerCallbacks, so it includes the new callback. The existing trip test now has the cordoned node present.docs/circuit-breaker.md,docs/configuration/fault-quarantine.mdanddocs/METRICS.mddescribe the narrower trip, anddocs/circuit-breaker.mdsays the cordons of deleted nodes are removed when the last GPU node is deleted.Type of Change
Component(s) Affected
Testing
With the forget callback turned off, the three
Forgetsenvtests fail withShould be falseon the replacement'sIsTripped, and theKeepstest still passes.Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
When no GPU nodes are counted, a recent cordon trips the circuit breaker only if the cordoned node is still in the cluster. If checking whether a node exists fails, the breaker returns an error.
Deleted-node cordons continue counting toward the threshold while GPU nodes remain and the cordons are within the monitoring window. When the last GPU node is deleted, cordons for deleted nodes are cleared, giving returning GPU nodes a fresh threshold budget.
Documentation
* Clarified how cordoned and deleted nodes affect breaker thresholds and troubleshooting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->