weizhouapache commented on code in PR #7915:
URL: https://github.com/apache/cloudstack/pull/7915#discussion_r1328698199


##########
server/src/main/java/com/cloud/user/DomainManagerImpl.java:
##########
@@ -344,56 +345,67 @@ public boolean deleteDomain(long domainId, Boolean 
cleanup) {
 
     @Override
     public boolean deleteDomain(DomainVO domain, Boolean cleanup) {
-        GlobalLock lock = getGlobalLock("AccountCleanup");
+        GlobalLock lock = getGlobalLock();
+        if (lock == null) return false;
+
+        try {
+            // mark domain as inactive
+            s_logger.debug("Marking domain id=" + domain.getId() + " as " + 
Domain.State.Inactive + " before actually deleting it");
+            domain.setState(Domain.State.Inactive);
+            _domainDao.update(domain.getId(), domain);
+
+            return cleanDomain(domain, cleanup);
+        }
+        finally {
+            lock.unlock();
+        }
+    }
+
+    @Nullable

Review Comment:
   do we need this annotation ?
   ```
   import org.jetbrains.annotations.Nullable;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to