Skip to content

Retry to delete distribution VHD for up to 10 seconds - #41153

Merged
Blue (OneBlue) merged 1 commit into
masterfrom
user/oneblue/delete-vhd-retry
Jul 23, 2026
Merged

Retry to delete distribution VHD for up to 10 seconds#41153
Blue (OneBlue) merged 1 commit into
masterfrom
user/oneblue/delete-vhd-retry

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds logic to retry deleting WSL distribution VHDs for up to 10 seconds. We've seen test failures caused by that file being in used during un-registration.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@OneBlue
Blue (OneBlue) requested a review from a team as a code owner July 23, 2026 20:33
Copilot AI review requested due to automatic review settings July 23, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves the robustness of WSL distribution un-registration by retrying deletion of the distro VHD when the file is temporarily in use (e.g., due to sharing violations), reducing intermittent test failures during cleanup.

Changes:

  • Replace single-attempt VHD deletion with a bounded retry loop (100ms interval, up to 10 seconds).
  • Retry only on ERROR_SHARING_VIOLATION, logging the failure after the timeout expires.

@OneBlue
Blue (OneBlue) merged commit 81a3508 into master Jul 23, 2026
12 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/delete-vhd-retry branch July 23, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants