CLOUDSTACK-8022: [Automation] Deletion of Domain with Cleanup set to "true" 
fails

Changes:

-  This is a race condition between the deleteDomain thread and AccountChecker 
thread. DeleteDomain thread marks the domain as inactive and proceeds for 
cleanup, AccountChecker thread that runs at the same time cleans up any domains 
marked as inactive.
-  When the DeleteDomain thread finds that domain is already removed, it need 
not error out since the domain deletion has already happened


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1c5e8ebb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1c5e8ebb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1c5e8ebb

Branch: refs/heads/master
Commit: 1c5e8ebb3113e97c6c0be9b602f9a15852f2d2fd
Parents: 01ae712
Author: Prachi Damle <[email protected]>
Authored: Tue Dec 16 16:26:16 2014 -0800
Committer: Prachi Damle <[email protected]>
Committed: Wed Dec 17 13:53:30 2014 -0800

----------------------------------------------------------------------
 engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c5e8ebb/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java 
b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
index e02daf1..4c4fe86 100644
--- a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
+++ b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
@@ -154,8 +154,8 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, 
Long> implements Dom
 
         DomainVO domain = findById(id);
         if (domain == null) {
-            s_logger.error("Unable to remove domain as domain " + id + " no 
longer exists");
-            return false;
+            s_logger.info("Unable to remove domain as domain " + id + " no 
longer exists");
+            return true;
         }
 
         if (domain.getParent() == null) {

Reply via email to