← Back to Pull requests

resmgr: retain pending updates on nri failure #809

Closed
unknown closed this pull request without merging on Sep 23, 2026 08:16 UTC
View on GitHub
unknown unknown commented on Sep 22, 2026 14:09 UTC
Author

Pending container updates that go out through UpdateContainers() are currently taken from their containers before the push: updateContainers() starts with getPendingUpdates(), which clears each update as it returns it. If the push then fails, the update is gone - and it was the only record of what the container should have looked like, so the container keeps its old resources and there is nothing left to retry it with.

The updates are now taken from their containers only once the runtime has them. updateContainers() peeks at the pending updates, pushes them, and clears the ones that were delivered; a failed request leaves all of them pending.

The runtime can also accept the request and report back the updates it could not apply. That answer used to be discarded. Those containers were not updated either, so their updates now stay pending just the same, and a warning names them.

The updates carried by an NRI response are unchanged: they are still taken as they are collected, because nothing acknowledges them - of the NRI messages only UpdateContainersResponse has a failed field — so there is no later point to clear them at, and keeping them would repeat them in every response from then on.

cache.Container accordingly trades its destructive GetPendingUpdate() for PeekPendingUpdate() and ClearPendingUpdate(): reading a pending update and discarding it are now separate steps, which is what the retry above needs.

This path is how any out-of-band allocation change reaches the runtime, so the existing user is policy reconfiguration; DRA claim allocation (#806) is what made the lost updates easy to hit.

Tests: pkg/resmgr/nri_test.go` covers the three outcomes — retained when the request fails, cleared when the runtime has them, retained for the containers the runtime rejected. The first and third fail against the previous behaviour.

Diff: 237 lines (+177 / -60) across 2 files Reviewer: klihub Review duration: 1086m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 237 lines diff across 2 files
0.37
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.327
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #809"
general weight: 0.35
Reviewers
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: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
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.7% · Safe to merge
14.7%