Skip to content

Commit 4e61e49

Browse files
author
Prachi Damle
committed
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.
1 parent 0879ab8 commit 4e61e49

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

server/src/com/cloud/user/AccountManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,10 @@ protected boolean cleanupAccount(AccountVO account, long callerUserId, Account c
660660
// delete the account from project accounts
661661
_projectAccountDao.removeAccountFromProjects(accountId);
662662

663-
//delete the account from group
664-
_messageBus.publish(_name, MESSAGE_REMOVE_ACCOUNT_EVENT, PublishScope.LOCAL, accountId);
663+
if (account.getType() != Account.ACCOUNT_TYPE_PROJECT) {
664+
// delete the account from group
665+
_messageBus.publish(_name, MESSAGE_REMOVE_ACCOUNT_EVENT, PublishScope.LOCAL, accountId);
666+
}
665667

666668
// delete all vm groups belonging to accont
667669
List<InstanceGroupVO> groups = _vmGroupDao.listByAccountId(accountId);

services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public List<IAMGroup> listIAMGroups(long accountId) {
147147

148148
List<Long> groupIds = _aclGroupAccountMapDao.customSearch(groupSc, null);
149149

150+
if (groupIds == null || groupIds.isEmpty()) {
151+
return new ArrayList<IAMGroup>();
152+
}
150153
SearchBuilder<IAMGroupVO> sb = _aclGroupDao.createSearchBuilder();
151154
sb.and("ids", sb.entity().getId(), Op.IN);
152155
SearchCriteria<IAMGroupVO> sc = sb.create();

0 commit comments

Comments
 (0)