Fix/13612 template cleanup on domain delete#13614
Open
Chinmay048 wants to merge 2 commits into
Open
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a cleanup edge case during account/domain teardown where template deletions that return false could be effectively “masked” by later successful deletions, leading to premature domain deletion attempts while template artifacts still remained in secondary storage.
Changes:
- Update template cleanup loop in
AccountManagerImpl.cleanupAccountto treat anyfalsereturn from_tmpltMgr.delete(...)as a persistent failure signal (without being overwritten by later iterations). - Improve logging for the
falsereturn case and ensure exceptions also forceallTemplatesDeleted = false. - Ensure
accountCleanupNeededis set when any template deletion fails, preventing premature teardown.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
This PR fixes an issue where templates belonging to child accounts within a domain were not properly tracked during automated account and domain cleanup, causing domain deletion to fail due to orphaned storage resources.
Functional Changes:
AccountManagerImpl.cleanupAccountto explicitly check the boolean return value of_tmpltMgr.delete(...).allTemplatesDeletedtracking flag from being overwritten on subsequent loop iterations if an earlier template deletion fails.accountCleanupNeeded = true, preventing premature domain teardowns when child resources remain active in secondary storage.Types of changes
Checklist: