Skip to content

Add 'break' at RedifshClient request re-try loop (fixed issue from 4846)#4864

Merged
yadvr merged 4 commits intoapache:4.15from
CLDIN:redifsh-retry-break-fixlogformat
Mar 29, 2021
Merged

Add 'break' at RedifshClient request re-try loop (fixed issue from 4846)#4864
yadvr merged 4 commits intoapache:4.15from
CLDIN:redifsh-retry-break-fixlogformat

Conversation

@GabrielBrascher
Copy link
Copy Markdown
Member

Description

This PR adds a missing break at the HTTP request re-try loop.

It is a minor bug, but it can result in double re-try requests where one should be enough. Also, talking about corner cases, there is a small possibility of the first re-try request be successful, and the second fails, which could result in false error.

This PR added the break and also Test cases that cover such scenarios to ensure that now we have it all covered.

DISCLAIMER

This PR has fixed the log issue caused by the misplaced String.format attributes at cd5fe4b; merged in the context of #4846 and correctly reverted at #4861.

To make sure all is good I re-build with the fix, and also executed all unit tests.

$ mvn clean install
.....
[INFO] Apache CloudStack Console Proxy .................... SUCCESS [  0.009 s]
[INFO] Apache CloudStack Console Proxy - RDP Client ....... SUCCESS [  6.635 s]
[INFO] Apache CloudStack Console Proxy - Server ........... SUCCESS [  4.458 s]
[INFO] Apache CloudStack Framework - QuickCloud ........... SUCCESS [  0.043 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11:00 min
[INFO] Finished at: 2021-03-24T15:56:20-03:00
[INFO] ------------------------------------------------------------------------

Additionally, All the 19 tests at RedfishClientTest have passed after commit b9dd504.

1. RedfishClientTest.validateAddressAndPrepareForUrlTestIpv4        1.02 s  passed
2. RedfishClientTest.validateAddressAndPrepareForUrlTestIpv6        10 ms   passed
3. RedfishClientTest.retryHttpRequestExceptionAfterOneRetry         2.02 s  passed
4. RedfishClientTest.validateAddressAndPrepareForUrlTestExpect      20 ms   passed
5. RedfishClientTest.retryHttpRequestSuccessAtTheSecondRetry        4.02 s  passed
6. RedfishClientTest.buildRequestUrlTestHttpsComputerSystemReset    61 ms   passed
7. RedfishClientTest.validateAddressAndPrepareForUrlTestDomainName  1 ms    passed
8. RedfishClientTest.buildRequestUrlTestGetSystemId                 1 ms    passed
9. RedfishClientTest.getSystemIdTestHttpStatusNotOk                 53 ms   passed
10. RedfishClientTest.buildRequestUrlTestComputerSystemReset        1 ms    passed
11. RedfishClientTest.getSystemPowerStateTest                       4 ms    passed
12. RedfishClientTest.getSystemIdTest                               2 ms    passed
13. RedfishClientTest.retryHttpRequestNoException                   6.01 s  passed
14. RedfishClientTest.buildRequestUrlTestHttpsGetPowerState         3 ms    passed
15. RedfishClientTest.getSystemPowerStateTestHttpStatusNotOk        10 ms   passed
16. RedfishClientTest.buildRequestUrlTestGetPowerState              4 ms    passed
17. RedfishClientTest.buildRequestUrlTestHttpsGetSystemId           3 ms    passed
18. RedfishClientTest.retryHttpRequestNoRetries                     3 ms    passed
19. RedfishClientTest.retryHttpRequestExceptionAfterTwoRetries      4.00 s  passed

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)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

A - Test steps with 4.15.0.0:

connect at the JVM via remote debug
place breakpoints and tail logs
verify that it keeps attempting new HTTP requests even with the previous not failing until it reaches 3 attempts

B - Test this implementation (4.15.1.0-SNAPSHOT):

build packages
update mgmt server
connect on JVM to remote debug
place breakpoints and tail logs
verify that the break indeed works if the HTTP request has not failed

@GabrielBrascher GabrielBrascher added this to the 4.15.1.0 milestone Mar 24, 2021
@GabrielBrascher GabrielBrascher self-assigned this Mar 24, 2021
@GabrielBrascher
Copy link
Copy Markdown
Member Author

@blueorangutan package

@GabrielBrascher GabrielBrascher changed the title Redifsh retry break fixlogformat Add 'break' at RedifshClient request re-try loop (fixed issue from 4846) Mar 24, 2021
@blueorangutan
Copy link
Copy Markdown

@GabrielBrascher 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: ✖️ centos7 ✔️ centos8 ✔️ debian. SL-JID 250

@GabrielBrascher
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@GabrielBrascher 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: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 262

@blueorangutan
Copy link
Copy Markdown

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

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Mar 29, 2021

Merging this based on #4846 as now packaging is working, Travis passes (not unit test failure seen). Thanks @GabrielBrascher

@yadvr yadvr merged commit d6a7427 into apache:4.15 Mar 29, 2021
@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-277)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43765 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4864-t277-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_affinity_groups_projects.py
Intermittent failure detected: /marvin/tests/smoke/test_affinity_groups.py
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_router_nics.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 79 look OK, 7 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_DeployVmAntiAffinityGroup_in_project Error 57.73 test_affinity_groups_projects.py
test_DeployVmAntiAffinityGroup Error 36.39 test_affinity_groups.py
test_04_deploy_and_scale_kubernetes_cluster Failure 24.68 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_08_deploy_and_upgrade_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 39.23 test_kubernetes_clusters.py
test_01_isolate_network_FW_PF_default_routes_egress_true Failure 71.86 test_routers_network_ops.py
ContextSuite context=TestVPCRedundancy>:setup Error 0.00 test_vpc_redundant.py
ContextSuite context=TestVPCNics>:setup Error 0.00 test_vpc_router_nics.py
ContextSuite context=TestRVPCSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcRemoteAccessVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py

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.

3 participants