cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [05/48] git commit: updated refs/heads/ui-vm-affinity to 96999be
Date Thu, 11 Apr 2013 22:13:13 GMT
CLOUDSTACK-2003: When accounts and domains are deleted, cleanup can fail,
leaving instances in eternal expunged state. This happens when a domain is
deleted while a deleted account is cleaning up. The cleanup looks for the domain
of the account and we hit a null pointer. Adding null pointer check.

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1365695448 -0600


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

Branch: refs/heads/ui-vm-affinity
Commit: ca8ac08cf37cd9ea8a50d323ac596da16319e7ab
Parents: d39a06c
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Thu Apr 11 09:50:48 2013 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Thu Apr 11 09:50:48 2013 -0600

----------------------------------------------------------------------
 server/src/com/cloud/domain/dao/DomainDaoImpl.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca8ac08c/server/src/com/cloud/domain/dao/DomainDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/domain/dao/DomainDaoImpl.java b/server/src/com/cloud/domain/dao/DomainDaoImpl.java
index 79ef17e..c30ca5e 100644
--- a/server/src/com/cloud/domain/dao/DomainDaoImpl.java
+++ b/server/src/com/cloud/domain/dao/DomainDaoImpl.java
@@ -262,11 +262,14 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long>
implements Dom
     public Set<Long> getDomainParentIds(long domainId) {
         Set<Long> parentDomains = new HashSet<Long>();
         Domain domain = findById(domainId);
-        parentDomains.add(domain.getId());
-        
-        while (domain.getParent() != null) {
-            domain = findById(domain.getParent());
+
+        if (domain != null) {
             parentDomains.add(domain.getId());
+
+            while (domain.getParent() != null) {
+                domain = findById(domain.getParent());
+                parentDomains.add(domain.getId());
+            }
         }
         
         return parentDomains;


Mime
View raw message