You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2014/03/28 22:57:17 UTC

git commit: updated refs/heads/master to 4e61e49

Repository: cloudstack
Updated Branches:
  refs/heads/master 0879ab812 -> 4e61e4914


CLOUDSTACK-6303 [Automation] [UI] Account creation hang in UI

Changes:
- Caused due to a MySql error during 'Project' account cleanup. The MySql error hits a deadlock bug in the MessageBus code that does not release the lock/decrement the counter Eventually all callers on the MessageBus end up waiting to enter
- This fixes the account cleanup MySql error.


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

Branch: refs/heads/master
Commit: 4e61e49143ceceb04efbba62e048c648be97cfc4
Parents: 0879ab8
Author: Prachi Damle <pr...@cloud.com>
Authored: Fri Mar 28 14:00:39 2014 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Fri Mar 28 14:35:00 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/user/AccountManagerImpl.java              | 6 ++++--
 .../src/org/apache/cloudstack/iam/server/IAMServiceImpl.java   | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e61e491/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index f0d129a..2070ee6 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -660,8 +660,10 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
             // delete the account from project accounts
             _projectAccountDao.removeAccountFromProjects(accountId);
 
-            //delete the account from group
-            _messageBus.publish(_name, MESSAGE_REMOVE_ACCOUNT_EVENT, PublishScope.LOCAL, accountId);
+            if (account.getType() != Account.ACCOUNT_TYPE_PROJECT) {
+                // delete the account from group
+                _messageBus.publish(_name, MESSAGE_REMOVE_ACCOUNT_EVENT, PublishScope.LOCAL, accountId);
+            }
 
             // delete all vm groups belonging to accont
             List<InstanceGroupVO> groups = _vmGroupDao.listByAccountId(accountId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e61e491/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java
index 097d84f..56c931a 100644
--- a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java
+++ b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java
@@ -147,6 +147,9 @@ public class IAMServiceImpl extends ManagerBase implements IAMService, Manager {
 
         List<Long> groupIds = _aclGroupAccountMapDao.customSearch(groupSc, null);
 
+        if (groupIds == null || groupIds.isEmpty()) {
+            return new ArrayList<IAMGroup>();
+        }
         SearchBuilder<IAMGroupVO> sb = _aclGroupDao.createSearchBuilder();
         sb.and("ids", sb.entity().getId(), Op.IN);
         SearchCriteria<IAMGroupVO> sc = sb.create();