You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/02/02 14:11:20 UTC

[GitHub] [cloudstack] ravening opened a new pull request #4642: Display proper error message while deleting networks

ravening opened a new pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642


   ### Description
   Display exception message if the networks cant be deleted
   
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### 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)
   - [X] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [X] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland edited a comment on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland edited a comment on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771694748


   This method has usage in 5 different manager implementations:
   - [ ] KubernetesClusterDestroyWorker
   - [ ] NetworkServiceImpl
   - [ ] VpcManagerImpl
   - [ ] AccountManagerImpl
   - [ ] DomainManagerImpl
   
   As this changes the semantics of the call it needs thorough validation in all those components.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland edited a comment on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland edited a comment on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771694748


   This method has usage in 5 different manager implementations:
   - [ ] KubernetesClusterDestroyWorker
   - [ ] NetworkServiceImpl
   - [ ] VpcManagerImpl
   - [ ] AccountManagerImpl
   - [ ] DomainManagerImpl
   
   As this changes the semantics of the call it needs thorough validation in all those components.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771696056


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-772316187


   <b>Trillian test result (tid-3479)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 51640 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4642-t3479-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
   Intermittent failure detected: /marvin/tests/smoke/test_deploy_vm_iso.py
   Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
   Intermittent failure detected: /marvin/tests/smoke/test_iso.py
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
   Smoke tests completed. 84 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_create_iso_with_checksum_sha1 | `Error` | 65.51 | test_iso.py
   test_01_create_iso_with_checksum_sha1 | `Error` | 899.11 | test_iso.py
   test_04_extract_Iso | `Error` | 937.70 | test_iso.py
   test_01_add_delete_kubernetes_supported_version | `Error` | 905.10 | test_kubernetes_supported_versions.py
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#discussion_r569109914



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
##########
@@ -2882,8 +2882,9 @@ public boolean destroyNetwork(final long networkId, final ReservationContext con
 
         for (final UserVmVO vm : userVms) {
             if (!(vm.getState() == VirtualMachine.State.Expunging && vm.getRemoved() != null)) {
-                s_logger.warn("Can't delete the network, not all user vms are expunged. Vm " + vm + " is in " + vm.getState() + " state");
-                return false;
+                final String message = "Can't delete the network, not all user vms are expunged. Vm " + vm + " is in " + vm.getState() + " state";
+                s_logger.warn(message);
+                throw new InvalidParameterValueException(message);

Review comment:
       Throwing exceptions will cause other issues here, as already mentioned by Daan, other components are handling the boolean response either by logging error message or cleaning up some other resources upon error (AccountManagerImpl).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771694748


   This method has usage in 5 different manager implementations:
   [ ] KubernetesClusterDestroyWorker
   [ ] NetworkServiceImpl
   [ ] VpcManagerImpl
   [ ] AccountManagerImpl
   [ ] DomainManagerImpl
   
   As this changes the semantics of the call it needs thorough validation in all those components.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#discussion_r659346975



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
##########
@@ -2882,8 +2882,9 @@ public boolean destroyNetwork(final long networkId, final ReservationContext con
 
         for (final UserVmVO vm : userVms) {
             if (!(vm.getState() == VirtualMachine.State.Expunging && vm.getRemoved() != null)) {
-                s_logger.warn("Can't delete the network, not all user vms are expunged. Vm " + vm + " is in " + vm.getState() + " state");
-                return false;
+                final String message = "Can't delete the network, not all user vms are expunged. Vm " + vm + " is in " + vm.getState() + " state";
+                s_logger.warn(message);
+                throw new InvalidParameterValueException(message);

Review comment:
       > Throwing exceptions will cause other issues here, as already mentioned by Daan, other components are handling the boolean response either by logging error message or cleaning up some other resources upon error (AccountManagerImpl).
   
   @ravening any update?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771725046


   Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2640


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771695398


   @blueorangutan package


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771798767


   @blueorangutan test


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771696056






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771799838


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642#issuecomment-771694748






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening closed pull request #4642: Display proper error message while deleting networks

Posted by GitBox <gi...@apache.org>.
ravening closed pull request #4642:
URL: https://github.com/apache/cloudstack/pull/4642


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org