Skip to content

[CLOUDSTACK-10196] Remove ejb-api 3.0 dependency#2348

Merged
yadvr merged 1 commit into
apache:masterfrom
rafaelweingartner:removeEjbDependency
Dec 18, 2017
Merged

[CLOUDSTACK-10196] Remove ejb-api 3.0 dependency#2348
yadvr merged 1 commit into
apache:masterfrom
rafaelweingartner:removeEjbDependency

Conversation

@rafaelweingartner

Copy link
Copy Markdown
Member

This PR is proposing the removal of "ejb-api" 3.0 JAR. We use spring to manage objects creation and injection. Thus, spring beans do not need the annotation @Local. The @component or the bean declaration in the XML is enough to wire the object in Spring life-cycle.

@marcaurele marcaurele left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup - The @Component annotation is not enough, otherwise the custom spring context in CS does not know in which context to put the bean since there is a context tree structure to avoid overrides by plugins (https://cwiki.apache.org/confluence/display/CLOUDSTACK/Plug-ins%2C+Modules%2C+and+Extensions).

@rafaelweingartner

Copy link
Copy Markdown
Member Author

Ah yeah, actually that depends.. that is why I mentioned that @component or XML declaration is enough. @Local is from a whole different framework that may be seen as an alternative to Spring, and that we do not use.

@marcaurele thanks for the review!

@yadvr yadvr added this to the 4.11 milestone Dec 10, 2017
@yadvr

yadvr commented Dec 11, 2017

Copy link
Copy Markdown
Member

Good cleanup, we'll need some extended testing on this one.

@yadvr

yadvr commented Dec 15, 2017

Copy link
Copy Markdown
Member

@rafaelweingartner can you fix the conflicts?

@rafaelweingartner

Copy link
Copy Markdown
Member Author

@rhtyd done!

@yadvr

yadvr commented Dec 15, 2017

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1382

@rafaelweingartner rafaelweingartner force-pushed the removeEjbDependency branch 4 times, most recently from b28e519 to 36cb848 Compare December 15, 2017 14:43
@yadvr

yadvr commented Dec 15, 2017

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1383

@yadvr

yadvr commented Dec 15, 2017

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1794)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30045 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2348-t1794-kvm-centos7.zip
Test completed. Failed tests results shown below:

Test Result Time (s) Test File
test_01_vpc_privategw_acl Failure 56.27 test_privategw_acl.py
test_02_vpc_privategw_static_routes Failure 222.51 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 127.16 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 302.84 test_privategw_acl.py
test_02_create_template_with_checksum_sha1 Error 5.15 test_templates.py
test_03_create_template_with_checksum_sha256 Error 5.14 test_templates.py
test_04_create_template_with_checksum_md5 Error 5.13 test_templates.py
test_01_vpc_remote_access_vpn Failure 60.62 test_vpc_vpn.py

@yadvr

yadvr commented Dec 16, 2017

Copy link
Copy Markdown
Member

LGTM, test LGTM as well. The failures are known issues.

}
});

for (Long vmId : affectedVms) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelweingartner why have you removed this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it was not making much sense to me; for every VM ID in affectedVms it executes an asynchronous task _executorPool.schedule(new WorkerThread(), delayMs, TimeUnit.MILLISECONDS);. The odd part is that the vmId is not used. All of the tasks are scheduled to be executed are the same.

Looking at com.cloud.network.security.SecurityGroupManagerImpl.work() closely, it seems that it is indeed used for something. I was expecting it to be a generic task where we send something to be computed on.

So, there this idea of security group work, and the guys that implemented this, probably wanted to execute/process a number of work that is equal to the number of affectedVms. It would have been clear if done in some other way… I will not refactor this.
I will re-added this bit again.

@rhtyd thanks for spotting that!

}
}

private void processScheduledWork() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of this method is commented, should we remove that too or keep this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, code commented, dead codes, or code not used should always be deleted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, see line 211 in CleanupThread, maybe remove the commented method as well?

@yadvr

yadvr commented Dec 16, 2017

Copy link
Copy Markdown
Member

@rafaelweingartner can you address outstanding queries, following which we can merge this.

@rafaelweingartner

rafaelweingartner commented Dec 16, 2017

Copy link
Copy Markdown
Member Author

@rhtyd I replied your inquiries.
Can you take a look at them?

Thanks for the feedback here!

P.S. I am not able to squash the commits now. I will do that on Monday (maybe tomorrow in the evening with a bit of luck)

@yadvr

yadvr commented Dec 17, 2017

Copy link
Copy Markdown
Member

@rafaelweingartner thanks, no need to squash yourself. I'll squash merge using Github. I'll re-review the changes, and kick another round of tests.

@yadvr

yadvr commented Dec 17, 2017

Copy link
Copy Markdown
Member

LGTM
@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1389

@yadvr

yadvr commented Dec 17, 2017

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1802)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 29391 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2348-t1802-kvm-centos7.zip
Test completed. Failed tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestDeployVirtioSCSIVM>:setup Error 0.00 test_deploy_virtio_scsi_vm.py
test_01_vpc_privategw_acl Failure 56.21 test_privategw_acl.py
test_02_vpc_privategw_static_routes Failure 187.13 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 121.88 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 207.22 test_privategw_acl.py
test_02_create_template_with_checksum_sha1 Error 5.15 test_templates.py
test_03_create_template_with_checksum_sha256 Error 5.14 test_templates.py
test_04_create_template_with_checksum_md5 Error 5.14 test_templates.py
test_01_vpc_remote_access_vpn Failure 65.64 test_vpc_vpn.py

@rafaelweingartner

Copy link
Copy Markdown
Member Author

@rhtyd commits squashed.
Thanks!

@yadvr

yadvr commented Dec 18, 2017

Copy link
Copy Markdown
Member

@rafaelweingartner do we have a jira ID for this?

@rafaelweingartner

Copy link
Copy Markdown
Member Author

Hmm, no...
I will create one now

@rafaelweingartner rafaelweingartner changed the title Remove ejb-api 3.0 dependency [CLOUDSTACK-10196] Remove ejb-api 3.0 dependency Dec 18, 2017
I also Fixed QuotaAlertManagerImplTest, which was injecting mock objects manually
@rafaelweingartner

Copy link
Copy Markdown
Member Author

@rhtyd done

@yadvr yadvr merged commit 3c6df7c into apache:master Dec 18, 2017
@yadvr

yadvr commented Dec 18, 2017

Copy link
Copy Markdown
Member

Merged based on review and test results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants