network: handle missing network when releasing public IP - #14133
Open
xujiantop-crypto wants to merge 2 commits into
Open
network: handle missing network when releasing public IP#14133xujiantop-crypto wants to merge 2 commits into
xujiantop-crypto wants to merge 2 commits into
Conversation
Signed-off-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
Signed-off-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14133 +/- ##
=========================================
Coverage 17.94% 17.94%
- Complexity 16145 16151 +6
=========================================
Files 5928 5928
Lines 535174 535176 +2
Branches 65494 65495 +1
=========================================
+ Hits 96017 96057 +40
+ Misses 428228 428181 -47
- Partials 10929 10938 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14068
During VPC teardown, a public IP can retain its associated network ID after the tier's network record has been deleted.
disassociatePublicIpAddresspasses the missing network toapplyIpAssociations, which dereferences it and aborts VPC deletion with aNullPointerException.Resolve the associated network before choosing the release path. When the network no longer exists, a releasing IP follows the existing quarantine and unassignment path. The association path continues to be used when the network exists.
The regression test supplies a non-null associated network ID whose DAO lookup returns null while the VPC still exists. It verifies successful release, quarantine, IP unassignment, VPC provider cleanup, annotation cleanup and lock release, without calling
applyIpAssociations. Additional tests cover successful and failed associations when the network exists, and prevent repeated quarantine/unassignment of an already free IP when the network is missing.This targets
4.22in accordance with the contribution guide's release-branch policy for bug fixes; the affected code is also present there.Validation
NullPointerExceptionon the unfixed4.22base.IpAddressManagerTestpasses: 30 tests, 0 failures/errors/skips. All 25 selected reactor modules succeed, with 0 Checkstyle violations (JDK 11).git diff --checkpasses.The Maven download plugin could not retrieve the system VM checksum file in this environment. I downloaded the unmodified official
https://download.cloudstack.org/systemvm/4.22/sha512sum.txttoengine/schema/dist/systemvm-templates/sha512sum.txtand ran:mvn -B -pl server -am -Dtest=IpAddressManagerTest -Dsurefire.failIfNoSpecifiedTests=false -Ddownload.plugin.skip=true testOnly the redundant download was skipped; compilation, Checkstyle and the selected tests ran. No build configuration changes are included.
For an environment-level check, follow the steps in #14068: create a VPC offering with firewall service enabled, deploy a tier and VM, apply a public-IP firewall rule, remove the VM and tier, then destroy the VPC. The VPC should be removed without the missing-network exception and the public IP should be released. This full VPC scenario has not been run locally.