← Back to Pull requests

[YUNIKORN-3599] Unreserve DRA claims after the pod leaves the cache #1150

Closed
unknown closed this pull request without merging on Nov 24, 2026 14:18 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 16:13 UTC
Author

Description

Context.unreserve looks up the pod, node and cycle state in the scheduler cache and returns early when one is missing. Deleting a pod removes its cycle state. If a DRA pod is deleted right after Reserve, preBind fails as it should, but unreserve also returns before it calls the DRA plugin's Unreserve. The in-flight allocations that Reserve added are not removed, and the shim keeps counting their devices as allocated.

reserve now returns the cycle state it passed to the plugins, and the bind goroutine passes it to unreserve with the pod and the node name. If the plugins did not run, for example because the node was deleted before Reserve, the state is nil and Unreserve is skipped. PredicateManager.Unreserve takes the node name instead of a NodeInfo, because the plugins only use the name. Unreserve now also runs when the node is deleted after Reserve.

Type of change

  • Bug Fix
  • Jira issue

    Jira ID : https://issues.apache.org/jira/browse/YUNIKORN-3599

  • I have created a Jira issue for this pull request.

  • The Jira ID is part of the title of this pull request.
  • AI Tooling


    If an AI tool was used:
  • The PR includes the phrase "Generated by \<tool>", where \<tool> is the name of the AI tool used.

  • My use of AI contributions follows the ASF legal policy.
  • Check https://www.apache.org/legal/generative-tooling.html for details.

    Generated by Claude Code.
    AI helped analyze the bug and write and test the patch.

    How has this been tested?

  • New unit tests were added to cover new or changed code paths.

  • make test_all was run, and no failures reported.

  • make e2e_test was run, and no failures reported.

  • new e2e tests have been added.
  • TestPostTaskAllocatedWithDRABindings has new cases that remove the pod or the node from the cache during the pod bind, where Unreserve must still run; on master it does not. Other cases check that Unreserve runs after a failed volume bind, and that it is skipped when the node is gone before Reserve. TestRescheduleOnBindFailure_ClearsStateAndReschedules checks that it is skipped for a pod without resource claims, and TestPreBindPlugin checks the node name it gets.

    The Jira case, a delete right after Reserve, is not in the tests. In a local test where the delete comes in while Reserve runs, Unreserve is called 0 times on master and once with this change.

    Questions:

  • The change needs documentation, a pull request for apache/yunikorn-site repository will be created.

  • There is breaking changes for older versions: jira is tagged with release-notes label.

  • The licenses files needs to be updated.
  • Diff: 334 lines (+250 / -84) across 4 files Reviewer: thc1006 Review duration: 7085m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 334 lines diff across 4 files
    0.42
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1150"
    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.2% (MEDIUM) · Higher = larger blast radius
    42.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: 16.7% · Safe to merge
    16.7%