Skip to content

Remove duplicate network state checks before shutdown network#8462

Merged
DaanHoogland merged 5 commits intoapache:4.19from
shapeblue:duplicate-checks-in-shutdown-network
Jun 21, 2024
Merged

Remove duplicate network state checks before shutdown network#8462
DaanHoogland merged 5 commits intoapache:4.19from
shapeblue:duplicate-checks-in-shutdown-network

Conversation

@sureshanaparti
Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti commented Jan 8, 2024

Description

This PR removes duplicate network state checks before shutdown network (seems these checks again are not required, maybe added while resolving conflicts),and adds unit tests for the network state checks in shutdown network.

Keeping this checks after acquiring lock, removed others.

if (network.getState() == Network.State.Allocated) {
s_logger.debug("Network is already shutdown: " + network);
return true;
}
if (network.getState() != Network.State.Implemented && network.getState() != Network.State.Shutdown) {
s_logger.debug("Network is not implemented: " + network);
return false;

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)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

DuplicateCode_ShutdownNetwork

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.97%. Comparing base (b2ef53b) to head (055f2bc).

Additional details and impacted files
@@            Coverage Diff             @@
##               4.19    #8462    +/-   ##
==========================================
  Coverage     14.96%   14.97%            
- Complexity    11013    11017     +4     
==========================================
  Files          5377     5377            
  Lines        469567   469561     -6     
  Branches      60162    59785   -377     
==========================================
+ Hits          70285    70300    +15     
+ Misses       391498   391473    -25     
- Partials       7784     7788     +4     
Flag Coverage Δ
uitests 4.29% <ø> (ø)
unittests 15.68% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8231

@sureshanaparti sureshanaparti force-pushed the duplicate-checks-in-shutdown-network branch from 0284972 to e4c6586 Compare January 10, 2024 05:13
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8286

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

I would also fix the log message at line 3034 to something like:

s_logger.debug(String.format("Network [%s] is in Allocated state, no need to shutdown.", network));

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8305

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM, didn't test it

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-8853)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48534 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8462-t8853-kvm-centos7.zip
Smoke tests completed. 120 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_create_pvlan_network Error 0.05 test_pvlan.py

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland added this to the 4.19.1.0 milestone Jan 17, 2024
@yadvr yadvr changed the base branch from main to 4.19 February 5, 2024 08:47
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm. didn't test.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@sureshanaparti , you want to revive this?

@vladimirpetrov vladimirpetrov self-assigned this Jun 11, 2024
@sureshanaparti sureshanaparti force-pushed the duplicate-checks-in-shutdown-network branch from 2386c0d to ec463c2 Compare June 12, 2024 15:21
@apache apache deleted a comment from blueorangutan Jun 12, 2024
@apache apache deleted a comment from blueorangutan Jun 12, 2024
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9905

Copy link
Copy Markdown
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing - did some smoke testing with different network types, create/restart with and without cleanup/destroy - no issues found.

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 21, 2024

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland DaanHoogland merged commit 9055610 into apache:4.19 Jun 21, 2024
@DaanHoogland
Copy link
Copy Markdown
Contributor

DaanHoogland commented Jun 21, 2024

sorry, was maybe a bit rash here, as smoke tests are still running. GHA were ok though, and prior run passed.

@sureshanaparti sureshanaparti deleted the duplicate-checks-in-shutdown-network branch June 21, 2024 12:15
@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-10548)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42492 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8462-t10548-kvm-centos7.zip
Smoke tests completed. 131 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants