Damans227 commented on code in PR #13914:
URL: https://github.com/apache/cloudstack/pull/13914#discussion_r4195237421


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -6652,21 +6652,22 @@ protected void 
mergeSnapshotIntoBaseFileWithEventsAndConfigurableTimeout(Domain
         }
 
         BlockCommitListener blockCommitListener = 
getBlockCommitListener(vmName);
+        int remainingTimeout = 0;
+        String mergeResult = "Got an exception during block commit wait. Check 
earlier logs for more info.";
         try {
             vm.addBlockJobListener(blockCommitListener);
 
             logger.info("Starting block commit of QCOW2 delta [{}] of VM [{}]. 
Using parameters: diskLabel [{}]; baseFilePath [{}]; topFilePath [{}]; 
commitFlags [{}]",
-                    snapshotName,
-                    vmName, diskLabel, baseFilePath, topFilePath, commitFlags);
+                    snapshotName, vmName, diskLabel, baseFilePath, 
topFilePath, commitFlags);
 
             vm.blockCommit(diskLabel, baseFilePath, topFilePath, 0, 
commitFlags);
 
-            checkBlockCommitProgress(vm, diskLabel, vmName, snapshotName, 
topFilePath, baseFilePath);
+            remainingTimeout = checkBlockCommitProgress(vm, diskLabel, vmName, 
snapshotName, topFilePath, baseFilePath);
+            mergeResult = blockCommitListener.getResult(remainingTimeout);

Review Comment:
   what happens if the job finishes on the last poll? the wait left is 0 here, 
so an event that shows up a moment late gets reported as a failed commit



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to