fix validator race condition for mig-manager #3156
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 333 lines diff across 4 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
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3156"
general
weight: 0.35
rahulait
Description
We have a race condition in the mig-manager. During a MIG layout change, the
cuda-validationinit container of theoperator validator can create the
nvidia-cuda-validatorpod while MIG Manager runsnvidia-mig-parted apply. The pod runsvectorAddwithNVIDIA_VISIBLE_DEVICES=all. CUDA initialization opens every MIG instance on the node. MIG Manager then cannot destroy the compute instances, and the change fails:error destroying Compute instance for profile '(0, 0)': ERROR_IN_USE
MIG Manager then sets
nvidia.com/mig.config.state=failed.The race occurs because:
1. MIG Manager restarts the validator and sets
successbefore validationfinishes. A client that starts the next change on
successstarts itwhile the validator is still running.
2. MIG Manager deletes CUDA validator pods only once, a few seconds before
apply. A pod that the validator creates after this point is notdetected.
3. The validator does not check the MIG state before it runs the workload.
Nodes with many GPUs fail more often. On 8 x H200 with
all-1g.18gb(56 MIG instances),
vectorAddheld the instances for about 6 seconds, andthe first
all-1g.18gbtoall-1g.35gbchange failed.Fix
nvidia.com/mig.config.stateispendingorrebooting.--sleep-interval-secondssetting(
SLEEP_INTERVAL_SECONDS, default 5 seconds). The first read occurs atonce, so a node with no MIG change in progress sends 1 extra read.
error that names the last state. The init container fails, and the kubelet
retries it.
success, andfailed, thevalidator continues as before.
Checklist
make lint)make validate-generated-assets)make validate-modules)Testing
Added unit test and also tested the fix on an actual 8 x H200 Node.
<!-- devin-review-badge-begin -->
---
<a href="https://nvidia-cloud.devinenterprise.com/review/nvidia/gpu-operator/pull/3156" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->