Skip to content

Conversation

@DaanHoogland
Copy link
Contributor

Description

This PR adds a debug facility.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@blueorangutan
Copy link

Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 397

@DaanHoogland DaanHoogland marked this pull request as ready for review June 29, 2021 06:25
@DaanHoogland DaanHoogland added this to the 4.16.0.0 milestone Jun 29, 2021
throw new InvalidParameterValueException("Unable to find UUID for id " + customId);
throw new InvalidParameterValueException(String.format("Unable to find UUID for id %s of type %s",
customId,
(entityType == null ? "<unknown type>" ? entityType.getSimpleName())));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(entityType == null ? "<unknown type>" ? entityType.getSimpleName())));
(entityType == null ? "<null>" ? entityType.getSimpleName())));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am open to alternatives, but I don't like the , how about just "unknown"?

Copy link
Contributor

Choose a reason for hiding this comment

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

"unknown" sounds good.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

if (customId == null) {
return null;
}
Identity identity = (Identity) this._entityMgr.findById(entityType, customId);
Copy link
Contributor

Choose a reason for hiding this comment

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

@DaanHoogland when entityType is null, I think, it fails here (with NPE below stack), can you please check that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yhe NPE would be thrown in the call to findById() @sureshanaparti @rhtyd

    @Override
    public <T, K extends Serializable> T findById(Class<T> entityType, K id) {
        GenericDao<? extends T, K> dao = (GenericDao<? extends T, K>)GenericDaoBase.getDao(entityType);
        return dao.findById(id);
    }

I'm fine with applying the extra check in this case but I think it'll be unreachable code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sureshanaparti , as shown above, this NPE is going to happen out of scope of this change anyway, in these kinds of bits of code. What do you suggest to do?

Copy link
Contributor

@sureshanaparti sureshanaparti Jul 19, 2021

Choose a reason for hiding this comment

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

@DaanHoogland my suggestion is if entityType is null, better throw exception as below

InvalidParameterValueException("Unknown entity type")

and when identity is null (here entityType is not null), better throw exception as below

InvalidParameterValueException(String.format("Unable to find UUID for id [%s] of type [%s]",
                                                                    customId, entityType.getSimpleName()));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good @sureshanaparti

throw new InvalidParameterValueException("Unable to find UUID for id " + customId);
throw new InvalidParameterValueException(String.format("Unable to find UUID for id %s of type %s",
customId,
(entityType == null ? "<unknown type>" ? entityType.getSimpleName())));
Copy link
Contributor

Choose a reason for hiding this comment

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

"unknown" sounds good.

Identity identity = (Identity) this._entityMgr.findById(entityType, customId);
if (identity == null) {
throw new InvalidParameterValueException("Unable to find UUID for id " + customId);
throw new InvalidParameterValueException(String.format("Unable to find UUID for id %s of type %s",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest you to use [] as var delimiter; IMHO, it is easier to recognize what is a variable and what is fixed in the final message; e.g.:

String.format("Unable to find UUID for id [%s] of type [%s].",...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

Code LGTM

@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian. SL-JID 551

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian. SL-JID 563

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian. SL-JID 565

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 567

@blueorangutan
Copy link

Trillian Build Failed (tid-1294)

@blueorangutan
Copy link

Trillian test result (tid-1295)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 44190 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5163-t1295-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_network.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 86 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_isolate_network_FW_PF_default_routes_egress_true Failure 291.61 test_routers_network_ops.py
test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Failure 342.20 test_routers_network_ops.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 542.25 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 460.16 test_vpc_redundant.py

@blueorangutan
Copy link

Trillian test result (tid-1306)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47335 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5163-t1306-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_network.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_snapshots.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 87 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Failure 340.28 test_routers_network_ops.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 538.07 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 524.92 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 499.81 test_vpc_redundant.py

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 585

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 587

@sureshanaparti
Copy link
Contributor

@blueorangutan test

@apache apache deleted a comment from blueorangutan Jul 19, 2021
@apache apache deleted a comment from blueorangutan Jul 19, 2021
@blueorangutan
Copy link

Trillian Build Failed (tid-1316)

@apache apache deleted a comment from blueorangutan Jul 20, 2021
@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 595

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@apache apache deleted a comment from blueorangutan Jul 20, 2021
@apache apache deleted a comment from blueorangutan Jul 20, 2021
@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 598

@sureshanaparti
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-1323)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41259 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5163-t1323-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 87 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_vpc_privategw_restart_vpc_cleanup Failure 1015.47 test_privategw_acl.py
test_01_service_offering_cpu_limit_use Error 811.19 test_service_offerings.py

@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 607

@nvazquez
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-1330)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33541 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5163-t1330-kvm-centos7.zip
Smoke tests completed. 89 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez
Copy link
Contributor

Merging based on approvals and test results

@nvazquez nvazquez merged commit 1f8b34f into apache:main Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants