xujiantop-crypto opened a new pull request, #14133: URL: https://github.com/apache/cloudstack/pull/14133
Fixes #14068 During VPC teardown, a public IP can retain its associated network ID after the tier's network record has been deleted. `disassociatePublicIpAddress` passes the missing network to `applyIpAssociations`, which dereferences it and aborts VPC deletion with a `NullPointerException`. 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. It verifies successful release, IP unassignment, annotation cleanup and lock release, without calling `applyIpAssociations`. This targets `4.22` in accordance with the contribution guide's release-branch policy for bug fixes; the affected code is also present there. ### Validation - On the unfixed `4.22` base, the new regression test fails with `NullPointerException`. - With the fix, the complete `IpAddressManagerTest` passes: 27 tests, 0 failures/errors/skips. All 25 selected reactor modules succeed, with 0 Checkstyle violations (JDK 11). - `git diff --check` passes. 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.txt` to `engine/schema/dist/systemvm-templates/sha512sum.txt` and ran: ```sh mvn -B -pl server -am -Dtest=IpAddressManagerTest -Dsurefire.failIfNoSpecifiedTests=false -Ddownload.plugin.skip=true test ``` Only 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. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
