mirror of
https://github.com/apache/cloudstack
synced 2026-09-02 01:31:09 +00:00
bug 11190: Treating the max account limits with -1 values as infinite. When acquiring a lock to check for resourceLimitExceeded if the lock times out then return as limit exceeded.
This commit is contained in:
parent
abc44ac283
commit
002d0fda5a
@ -377,7 +377,7 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
||||
AccountVO accountVo = _accountDao.findById(account.getAccountId());
|
||||
long accountLimit = findCorrectResourceLimit(accountVo, type);
|
||||
long potentialCount = _resourceCountDao.getAccountCount(account.getId(), type) + numResources;
|
||||
if (potentialCount > accountLimit) {
|
||||
if (accountLimit != -1 && potentialCount > accountLimit) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -394,12 +394,13 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
||||
DomainVO domain = _domainDao.findById(domainId);
|
||||
domainId = domain.getParent();
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
m_resourceCountLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user