Skip to content

fix: release ascend device resources when scheduling fails#5378

Closed
DSFans2014 wants to merge 4 commits into
volcano-sh:masterfrom
DSFans2014:fix/subresource-in-release
Closed

fix: release ascend device resources when scheduling fails#5378
DSFans2014 wants to merge 4 commits into
volcano-sh:masterfrom
DSFans2014:fix/subresource-in-release

Conversation

@DSFans2014

Copy link
Copy Markdown
Contributor

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

If scheduling fails (e.g., a dry-run failure as mentioned in #5335), the sequence unAllocate -> DeAllocateFunc -> Release will be triggered. However, the Release interface of the ascend device currently does not release any resources.

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@volcano-sh-bot volcano-sh-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lowang-bh for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors several methods in AscendDevices to be private and implements the Release method to clean up resources and remove pod annotations. It also introduces a utility function RemovePodAnnotations to perform strategic merge patches for annotation removal. Feedback from the review highlights potential nil pointer dereferences in both Release and RemovePodAnnotations, suggests using tabs instead of spaces for standard Go formatting, and recommends a more idiomatic slice initialization in removeAnnotations to avoid multiple allocations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/scheduler/api/devices/ascend/hami/device_info.go
Comment thread pkg/scheduler/api/devices/util.go
Comment thread pkg/scheduler/api/devices/ascend/hami/device_info.go
Signed-off-by: james <open4pd@4paradigm.com>
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository.
Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: james <open4pd@4paradigm.com>
…resource-in-release

Signed-off-by: james <open4pd@4paradigm.com>
@DSFans2014 DSFans2014 closed this Jun 10, 2026
@JesseStutler

Copy link
Copy Markdown
Member

@DSFans2014 Hi, why it's been closed?

@DSFans2014

Copy link
Copy Markdown
Contributor Author

@DSFans2014 Hi, why it's been closed?

#5416 cleans all device resources, authored by @archlitchi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/contains-merge-commits do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants