test: ResourceCloserList.Release continues on error (Copilot review test)#3
Open
shreyanshjain7174 wants to merge 2 commits intomainfrom
Open
test: ResourceCloserList.Release continues on error (Copilot review test)#3shreyanshjain7174 wants to merge 2 commits intomainfrom
shreyanshjain7174 wants to merge 2 commits intomainfrom
Conversation
added 2 commits
March 18, 2026 18:14
Add automated GitHub Copilot review that triggers only when v2 shim code paths are modified. Copilot is guidance-only; CI remains the gate. - copilot-instructions.md: global review tone and format rules - v2-shim.instructions.md: Go best practices + hcsshim-specific rules (resource lifecycle, handle leaks, concurrency, package layering) - copilot-review.yml: workflow to auto-request Copilot review on PRs touching shim binaries, internal/hcs*, uvm, controller, vm packages Signed-off-by: Shreyansh Sancheti <shreyanshjain7174@gmail.com> Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
ResourceCloserList.Release() previously returned on the first error, which could leak remaining resources. Changed to collect all errors and continue releasing, matching the behavior documented in the review instructions (cleanup functions MUST continue releasing remaining resources even if one fails). Signed-off-by: Shreyansh Sancheti <shreyanshjain7174@gmail.com> Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Updates the internal/resources cleanup helper to ensure resource release continues even when individual Release() calls fail, reducing the risk of leaks during error unwinding in the v2 shim resource lifecycle.
Changes:
- Modify
ResourceCloserList.Release()to attempt all releases (reverse order) and aggregate errors. - Return a combined error via
errors.Join(...)instead of returning early on first failure.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
190
to
+195
| if oErr := l.closers[i].Release(ctx); oErr != nil { | ||
| return oErr | ||
| log.G(ctx).WithError(oErr).Error("failed to release resource in ResourceCloserList") | ||
| errs = append(errs, oErr) | ||
| } | ||
| } | ||
| return nil | ||
| return errors.Join(errs...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test PR to validate Copilot Code Review configuration.
Changes
ResourceCloserList.Release()to continue cleanup on error instead of returning early. This touchesinternal/resources/which is in the v2 shim path filter.Expected behavior:
Copilot Review (V2 Shim)workflow triggers (path match:internal/resources/**)[BLOCKER]/[ISSUE]/[SUGGESTION]prefixes