← Back to Pull requests

topology-aware: restore DRA claims after a restart #859

Closed
unknown closed this pull request without merging on Oct 28, 2026 07:04 UTC
View on GitHub
unknown unknown commented on Oct 18, 2026 14:55 UTC
Author

topology-aware forgets its DRA claims when the plugin restarted. Setup() clears the policy's cache entries, and Sync() places every running container again, so containers holding a claim lost its CPUs, and new claims can get them. The kubelet does not prepare a claim again after our restart, so nothing rebuilt a claim once it was gone.

Now Setup() keeps the cache entries and restores the saved claim grants. Container grants are not restored: Sync() allocates every running container again, and finds the claims by then. A container which holds a claim the policy does not know gets a warning in the log.

If the new configuration cannot give a claim its CPUs, because they are reserved or no longer available or the pool is gone, the claim gets other CPUs of the same NUMA nodes, and Sync() moves its containers to them. A claim result is only a number of CPUs of a node, so the kubelet and the scheduler see no change. The claims which keep their CPUs are restored first, so a moved claim cannot take the CPUs of another claim. The start fails only when a node has too few CPUs for a claim. The error names the claim, and the agent writes it into the status of the config CR. Reverting the config lets the plugin start again with the claim restored. A runtime reconfiguration which cannot hold a claim is still refused.

Two fixes on the side: Reserve() took a reserved CPU which is also isolated for the isolated part of a claim, which also affected runtime reconfiguration on main. And the topology-aware policy tests unpacked the sysfs tarball once per test, about 20s each with -race, which made the package hit the 10m go test timeout. With one shared copy the package runs in 42s with -race.

Testing:

  • go test -race -count=1 ./... passes with the default 10m timeout.

  • golangci-lint v2.11.4 reports no issues.

  • e2e on Kubernetes 1.37 with DRAConsumableCapacity, with images built from this branch: test42 (topology-aware, also with DRANodeAllocatableResources) and test01-dra (template) pass. test42 restarts the plugin and checks that running containers keep their claimed CPUs and a new claim gets only free CPUs, that a config which reserves a CPU of a claim moves the claim and its containers to the free CPU of the same node, and that a config which leaves too few CPUs fails the start with the claim named in the config status. test01-dra restarts template with fewer allowed CPUs: the claim keeps its CPUs with a warning, and a new claim does not get them.
  • Diff: 314 lines (+235 / -79) across 3 files Reviewer: bart0sh Review duration: 13928m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 314 lines diff across 3 files
    0.40
    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.344
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #859"
    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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    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: 15.9% · Safe to merge
    15.9%