← Back to Pull requests

DRA: refresh node resources after claim changes #829

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

Refreshing node resources after claim changes

Eighth PR of the DRA series, on top of #823. Two commits: resmgr refreshes
the node resources after a claim change, and the test42-dra-devices e2e test
checks the NodeResourceTopology CR after a claim and after its release.

The NRI path refreshes the NodeResourceTopology CR and the node's extended
resources after every change to the policy's allocations. The claim path did
not, so after a claim was allocated or released both kept what the last NRI
event left them. With topology-aware, the CR then still showed the claimed CPUs
as free.

Now ClaimAllocated and ClaimReleased refresh both, after saving the cache
and updating the containers. A failed refresh is logged, as on the NRI path,
and does not fail the claim: it does not change what the claim was given. A
failed allocation is rolled back through ClaimReleased, which refreshes then.

A small helper, updateNodeResources(), now does the refresh. It replaces the
paired updateTopologyZones()/updateNodeExtendedResources() calls on the NRI
path and after a reconfiguration, so there is one list of what gets refreshed.

No policy or interface change is needed: the policy still answers
GetTopologyZones and GetExtendedResources when resmgr asks.

The e2e test

test42-dra-devices reads the shared cpuset attribute of a NUMA node's zone
in the CR. After a claim takes CPUs of a node, the zone must stop listing them.
After the claim is released, it must list them again. The NRI path also
refreshes the CR when the claiming container is created, so the first check is
only a sanity check. No container event follows the release, so the second
check passes only if the claim path refreshes the CR. The test's cpuset()
helper now also accepts an empty string, which is what a zone with no shared
CPUs left reports.

What is not here

These are known limitations, each lifted by a later PR in the series:

  • Claims do not survive a restart. They are saved with the other grants,

  • but the policy resets its saved state on start, so after the plugin
    restarts their CPUs are free again and can be granted twice.
  • No DeviceClass ships yet, so a claim needs one written by the user.
  • Verification

  • go test -race ./... passes, and golangci-lint finds no issues in

  • pkg/resmgr.
  • TestClaimCommitRefreshesNodeResources checks that allocating and releasing

  • a claim each refresh the node resources once, and that a failing NRT CR
    update does not fail either call. Removing either of the two new calls fails
    the test.
  • test42-dra-devices passes on n4c16 with Kubernetes 1.37, containerd

  • v2.4.1, and the DRAConsumableCapacity and DRANodeAllocatableResources
    gates. A claim for 2 CPUs of node 0 got 0-1, the CR dropped 0-1 from the
    zone's shared CPUs, and listed them again after the claim was released.

    Diff: 359 lines (+269 / -90) across 4 files Reviewer: askervin Review duration: 11201m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 359 lines diff across 4 files
    0.43
    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.352
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #829"
    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: 42.6% (MEDIUM) · Higher = larger blast radius
    42.6%
    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: 16.8% · Safe to merge
    16.8%