NPE fix while deleting storage pool when pool has detached volumes#12451
NPE fix while deleting storage pool when pool has detached volumes#12451borisstoyanov merged 8 commits intoapache:4.20from
Conversation
|
@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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12451 +/- ##
=========================================
Coverage 16.24% 16.24%
- Complexity 13393 13394 +1
=========================================
Files 5657 5657
Lines 499107 499109 +2
Branches 60574 60575 +1
=========================================
+ Hits 81069 81072 +3
Misses 409001 409001
+ Partials 9037 9036 -1
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:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a NullPointerException that occurred when deleting a storage pool containing detached volumes. The bug was in a logging method that attempted to retrieve VM information for volumes without checking if the volume had an associated VM instance.
Changes:
- Added null check for volume instance ID before attempting to retrieve VM information in logging code
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16395 |
|
@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16398 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15201)
|
|
@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16421 |
|
@sureshanaparti @DaanHoogland I believe this is already being addressed by #11817 (cc @hsato03) |
ok, it is on main however. I think we need it for 4.20. cc @sureshanaparti |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
@bernardodemarco I was testing something and got this issue, fixed and raised the PR, didn't check that it's already addressed. |
|
ok, sorry @sureshanaparti I jumped the gun. I see your comment, let’s fix here. |
|
@sureshanaparti , I did some damage control. Let me know if I need to revert all my wrong doings. |
| protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) { | ||
| StringBuilder sb = new StringBuilder(); | ||
| List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null); | ||
| List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol -> vol.getState() != Volume.State.Destroy).collect(Collectors.toList()); |
There was a problem hiding this comment.
The findByPoolId method already returns all volumes that are not in the Destroy and Expunged states.
This filter can be removed,
There was a problem hiding this comment.
updated the volume dao method names returning non destroyed volumes
|
@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 16463 |
|
@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16467 |
* 4.22: fix install path for systemvm templates when introducing new sec storage (#11605) fix Sensitive Data Exposure Through Exception Logging in OVM Hypervis… (#12032) Fix snapshot physical size after migration (#12166) ConfigDrive: use file absolute path instead of canonical path to create ISO (#11623) Add log for null templateVO (#12406) snapshot: fix listSnapshots for volume which got delete and whose storage pool got deleted (#12433) Notify user if template upgrade is not required (#12483) Fix: proper permissions for systemvm template registrations on hardened systems (#12098) Allow modification of user vm details if user.vm.readonly.details is empty (#10456) NPE fix while deleting storage pool when pool has detached volumes (#12451)

Description
This PR fixes NPE issue while deleting storage pool when pool has detached volumes.
Noticed the below exception while deleting the pool:
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Deleted storage pool when pool has detached volumes on it. Expunged the volumes later and able to delete the pool.
BEFORE CHANGES:
DB:
AFTER CHANGES:
How did you try to break this feature and the system with this change?