-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix for listCapacity with fetchlatest parameter causing RuntimeException #12421
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: 4.20
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12421 +/- ##
============================================
+ Coverage 16.23% 17.76% +1.52%
- Complexity 13378 15863 +2485
============================================
Files 5657 5923 +266
Lines 498866 530603 +31737
Branches 60545 64835 +4290
============================================
+ Hits 81011 94273 +13262
- Misses 408821 425783 +16962
- Partials 9034 10547 +1513
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 |
|
@abh1sar 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. |
vishesh92
left a comment
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.
clgtm
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16357 |
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 RuntimeException that occurs when using the listCapacity API with the fetchlatest parameter. The issue is caused by nested transaction handling when updateCapacityForHost (which has the @DB annotation and manages its own transactions) is wrapped in an additional Transaction.execute block within a multi-threaded executor context.
Changes:
- Removed redundant
Transaction.executewrapper aroundupdateCapacityForHostcall inrecalculateHostCapacities() - Simplified the code by calling
updateCapacityForHostdirectly, relying on its@DBannotation for transaction management
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final HostVO host = hostDao.findById(hostId); | ||
| _capacityMgr.updateCapacityForHost(host); |
Copilot
AI
Jan 14, 2026
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.
The change correctly removes the redundant Transaction.execute wrapper. However, there's an inconsistency with recalculateStorageCapacities() (lines 313-347) which still uses Transaction.execute wrapper. For consistency and to prevent similar nested transaction issues, consider applying the same pattern if the methods called within have their own transaction management (e.g., if they use @db annotation or Transaction.execute internally).
Description
This PR fixes #12397
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested listCapacity api with fetchlatest parameter. No exceptions were observed.
Tested with the
Fetch Latestbutton on the capacity dashboard. Capacities were lister correctly.How did you try to break this feature and the system with this change?