Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions server/src/main/java/com/cloud/alert/AlertManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,8 @@ protected void recalculateHostCapacities() {
Math.min(CapacityManager.CapacityCalculateWorkers.value(), hostIds.size())));
for (Long hostId : hostIds) {
futures.put(hostId, executorService.submit(() -> {
Transaction.execute(new TransactionCallbackNoReturn() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
final HostVO host = hostDao.findById(hostId);
_capacityMgr.updateCapacityForHost(host);
}
});
final HostVO host = hostDao.findById(hostId);
_capacityMgr.updateCapacityForHost(host);
Comment on lines +297 to +298
Copy link

Copilot AI Jan 14, 2026

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).

Copilot uses AI. Check for mistakes.
return null;
}));
}
Expand Down
Loading