CLOUDSTACK-10175: prevent VPC list leakage#2352
Conversation
rafaelweingartner
left a comment
There was a problem hiding this comment.
@khos2ow thanks for the PR.
I have only one small comment in the code.
I also have one other question for you ,are you using the ApacheCloudStack code formatter?
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions
| permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); | ||
|
|
||
| //permittedAccounts can be empty when the caller is not a part of any project (a domain account) | ||
| if (permittedAccounts.isEmpty()) { |
There was a problem hiding this comment.
Is it possible for this permittedAccounts be null?
If not, the code is ok, otherwise it might be a good idea to use CollectionUtils.isEmpty
There was a problem hiding this comment.
There are multiple places which call AccountManagerImpl#buildACLSearchParameters and all of them have List<Long> permittedAccounts = new ArrayList<Long>();. So technically there's no need to check for null or use CollectionUtils.
There was a problem hiding this comment.
and yes, I'm using the same code formatter (checked in the repo) in Eclipse and not the eclipse.epf.
There was a problem hiding this comment.
thanks!
So, it seems that the code was not formatted properly before.
|
@DaanHoogland @PaulAngus @rhtyd would you please review/merge this PR? |
|
@rhtyd Can you review this? |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1411 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1823)
|
|
@khos2ow the test_deploy_virtio_scsi_vm related failures are new, rest are known issues and ignorable. can you check? |
|
@rhtyd yes I will. |
|
@khos2ow any update? |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1496 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1931)
|
|
Merged this based on two code review lgtms and test results (0 errors). |
This PR fixes the issue in which there's a leak when doing API call for listing VPC with domain account and projectId=-1.
Note for reviewers: The code formatting changed so many lines in the commit but the actual change is in line 2467-2471.