weizhouapache commented on a change in pull request #5687:
URL: https://github.com/apache/cloudstack/pull/5687#discussion_r753400695
##########
File path:
server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
##########
@@ -521,13 +520,21 @@ public void checkResourceLimit(final Account account,
final ResourceType type, l
}
final Project projectFinal = project;
+
+ // Check account limits. If it's unlimited then don't lock the db rows
+ long accountResourceLimit =
findCorrectResourceLimitForAccount(account, type);
+ if (Resource.RESOURCE_UNLIMITED == accountResourceLimit) {
Review comment:
@ravening
you may have noticed that there are two checks.
https://github.com/apache/cloudstack/blob/4.16.0.0/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java#L529-L532
```
// Check account limits
checkAccountResourceLimit(account, projectFinal, type,
numResources);
// check all domains in the account's domain hierarchy
checkDomainResourceLimit(account, projectFinal, type,
numResources);
```
these ensure that the resouce will not exceed the account and domain
limitation..
the 1st check will always pass if account resource limit is -1, but 2nd
check will not be skipped.
It makes sense to me.
You may need to discuss your colleagues if they expect an account with
resource limit =-1 in a domain can exceed the domain resource limit.
--
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]