Repository navigation
Fix listPublicIpAddresses NPE on shared networks with a VR - #14249
Conversation
JoaoJandre
left a comment
There was a problem hiding this comment.
CLGTM, did not test it
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14249 +/- ##
=========================================
Coverage 17.99% 18.00%
- Complexity 16215 16219 +4
=========================================
Files 5935 5936 +1
Lines 535706 535724 +18
Branches 65596 65598 +2
=========================================
+ Hits 96425 96446 +21
+ Misses 428292 428286 -6
- Partials 10989 10992 +3
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:
|
Damans227
left a comment
There was a problem hiding this comment.
thanks @MitchDrage, the placeholder only case is covered now. LGTM.
|
@vladimirpetrov @sureshanaparti could this go into the 4.22.2 milestone? It's a bug fix against 4.22. |
|
@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]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 19700 |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19701 |
vladimirpetrov
left a comment
There was a problem hiding this comment.
LGTM based on the following tests:
- VR running: repeated list calls never fail
- VR destroyed, only the placeholder left
- Other triggers: stop, reboot, restart with cleanup
- updateIpAddress on the VR IP (another caller of the same response code)
|
@blueorangutan test |
|
@vladimirpetrov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-17232)
|
Description
Fixes an intermittent NullPointerException in listPublicIpAddresses when a shared network has a VR.
For shared network IPs,
showVmInfoForSharedNetworks()looks up the NIC by IP and network. For the VR's IP there are two NICs, the real one and the VR's placeholder NIC (null instance_id), and the lookup returns one of them at random. When it gets the placeholder, the router branch added in #10458 callsgetInstanceId()and throws.This switches it to the existing
findNonPlaceHolderByIp4AddressAndNetworkId(). I've also setissystemto true in the router branch again. 4.20 set it for router IPs, #10458 changed it so thatissystemended up as false so I've switched it back to true. With it set to false, the UI offers Release IP on the VR's address which it shouldn't do.4.20 isn't affected.
Fixes #14248
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Added a unit test to ApiResponseHelperTest.
In the simulator, with a shared network on
DefaultSharedNetworkOfferingand one VM, about half of thelistPublicIpAddresses forvirtualnetwork=falsecalls failed before the change. After it, none did, and the VR's IP shows the router with issystem=true.We were hitting this on 4.22.1.0 in production too.
How did you try to break this feature and the system with this change?
Tried releasing the VR's IP afterwards. It's still refused, as it should be.