server: throw exception if fail to cleanup IP resources when release a public IP#9059
Conversation
|
@blueorangutan package |
|
@weizhouapache 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #9059 +/- ##
============================================
- Coverage 14.96% 14.95% -0.01%
- Complexity 10995 11017 +22
============================================
Files 5373 5382 +9
Lines 469024 470133 +1109
Branches 58818 59924 +1106
============================================
+ Hits 70197 70320 +123
- Misses 391056 392024 +968
- Partials 7771 7789 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| s_logger.warn("Failed to release resources for ip address id=" + addrId); | ||
| String msg = String.format("Failed to release resources for ip address id=%s", addrId); | ||
| s_logger.error(msg); | ||
| throw new CloudRuntimeException(msg); |
There was a problem hiding this comment.
does this block any other subsequent calls, & changes behavior?
There was a problem hiding this comment.
it does, but I think the process should be stopped here if the error happens.
There was a problem hiding this comment.
I think this is very much unreadible code:
- in a method named
disassociatePublicIpAddress(..) - after a call to
cleanupIpResources(..) - folows a call to
markIpAsUnavailable(..)
at the very least the last one must be renamed. I roposemarkIpForReleasing(..). Looking in the code, that is what it actually does.
I agree that some action other than marking for releasing should follow a failure to clean up. Let's investigate the callers and see what can be done.
There was a problem hiding this comment.
Hi @weizhouapache should these be addressed here, or later in separate PR?
There was a problem hiding this comment.
@sureshanaparti @DaanHoogland
renamed the last method from markAsUnavailable to markAsReleasing
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9576 |
|
@blueorangutan test matrix |
|
@weizhouapache a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-10194)
|
|
[SF] Trillian test result (tid-10192)
|
|
[SF] Trillian test result (tid-10193)
|
|
@blueorangutan package |
|
@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 package |
|
@weizhouapache 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10083 |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10085 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-10634)
|
| @@ -732,8 +732,9 @@ public boolean disassociatePublicIpAddress(long addrId, long userId, Account cal | |||
| PublicIpQuarantine publicIpQuarantine = null; | |||
| // Cleanup all ip address resources - PF/LB/Static nat rules | |||
| if (!cleanupIpResources(addrId, userId, caller)) { | |||
There was a problem hiding this comment.
Are the IP resources that are cleaned up by the cleanupIpResources method being rolled back when the exception is thrown?
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10195 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, but needs testing
|
I am not able to reproduce the behaviour, do you have any other specific steps I have followed these steps Create 2 sessions and execute the following API at the same time
Did not observe the log egrep 'Failed to release | Unable to revoke ' /var/log/cloudstack/management/management-server.log The create firewall API returns Also, I see the IPAddress present in the router even after the disassociate IP address is successfull cat /etc/cloudstack/ips.json |
@kiranchavala |
|
Closing |
Description
When reproduced the issue #8967, I got the following error
The errors are ignored, public IP is released successfully in cloudstack, but the IP is still associated to a VR. When associate the IP to another network, it caused an issue similar as #8967.
However, the reporter of #8967 could not find any error like "Failed to release" or "Unable to revoke" in their logs, so the root cause of #8967 could be different.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?