-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix NPE during VM IP fetch for shared networks #11389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #11389 +/- ##
=============================================
- Coverage 17.17% 3.63% -13.54%
=============================================
Files 5869 441 -5428
Lines 521590 36966 -484624
Branches 63485 6772 -56713
=============================================
- Hits 89562 1345 -88217
+ Misses 421962 35460 -386502
+ Partials 10066 161 -9905
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a NullPointerException that occurs during VM IP fetching for shared networks. The exception was happening when the VmIpFetchTask
tried to access the network ID from a null NIC object.
- Adds null check validation for VM, VM instance, and NIC objects before proceeding with IP fetch operations
- Fixes a typo in a configuration description ("entwork" → "network")
- Updates logging to use parameterized format instead of string concatenation
Comments suppressed due to low confidence (1)
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:721
- This null check is good and addresses the NPE issue, but it should be placed before line 2720 where
nicVo.getNetworkId()
was originally called to fully prevent the exception described in the PR.
}
@@ -672,7 +672,7 @@ public void setKubernetesServiceHelpers(final List<KubernetesServiceHelper> kube | |||
"Wait Interval (in seconds) for shared network vm dhcp ip addr fetch for next iteration ", true); | |||
|
|||
private static final ConfigKey<Integer> VmIpFetchTrialMax = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmip.max.retry", "10", | |||
"The max number of retrieval times for shared entwork vm dhcp ip fetch, in case of failures", true); | |||
"The max number of retrieval times for shared network vm dhcp ip fetch, in case of failures", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix for the typo correction from 'entwork' to 'network'.
Copilot uses AI. Check for mistakes.
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 14539 |
@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 14545 |
Description
This PR fixes NPE during VM IP fetch for shared networks.
Noticed several exceptions in smoke tests logs, for NPE during VmIpFetchTask.
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?