← Back to Pull requests

Fix the finalizer writes on Modules and their plugin Pods #1343

Closed
unknown closed this pull request without merging on Sep 22, 2026 07:10 UTC
View on GitHub
unknown unknown commented on Sep 08, 2026 12:37 UTC
Author

This is the first of the smaller pieces of #1342, which @TomerNewman asked me to split up. It carries the two finalizer-write fixes the rest of that work rests on, and nothing else.

What goes wrong

metadata.finalizers is a list, and a merge patch sends a list whole. setFinalizerAndStatus and finalizeModule both compute their patch from the Module they were handed, so a write from a read that predates another controller's entry takes that entry off along with its own. deleteFinalizer in the Pod node label reconciler has the same shape when it removes NodeLabelerFinalizer from a plugin Pod.

Nothing in tree puts a second finalizer on those objects today, which is why this has not been hit. The DRA and device plugin finalizers in #1342 do, and they are the ones that would go.

What this changes

The three writes now carry the resourceVersion they read, so a stale one comes back as a conflict and the next pass starts from a fresh read.

deleteLabel also reported a Node that had already gone as an error. NodeLabelerFinalizer then stayed on the Pod for good, and so did anything waiting for that Pod to go. A Node that is not there carries no label, so that reads as done.

Testing

Unit tests cover each of the three writes and the missing Node. I checked every one of them by reverting the fix and confirming which spec goes red.

Part of #1331.

---

This PR was written in part with the assistance of generative AI. I have reviewed and tested every change myself.

Diff: 187 lines (+140 / -47) across 2 files Reviewer: yevgeny-shnaidman Review duration: 19832m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 187 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.313
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1343"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.8% (MEDIUM) · Higher = larger blast radius
35.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.1% · Safe to merge
14.1%