abh1sar commented on code in PR #13424:
URL: https://github.com/apache/cloudstack/pull/13424#discussion_r3461228794


##########
scripts/vm/hypervisor/kvm/nasbackup.sh:
##########
@@ -196,10 +196,12 @@ backup_running_vm() {
 
   # Print statistics
   virsh -c qemu:///system domjobinfo $VM --completed
-  du -sb $dest | cut -f1
-
-  umount $mount_point
-  rmdir $mount_point
+  backup_size=$(du -sb "$dest" 2>/dev/null | cut -f1) || true
+  
+  timeout 60 umount "$mount_point" 2>/dev/null || true
+  rmdir "$mount_point" 2>/dev/null || true

Review Comment:
   Can we log the error (using log -e) instead of silently returning true here?



##########
scripts/vm/hypervisor/kvm/nasbackup.sh:
##########
@@ -196,10 +196,12 @@ backup_running_vm() {
 
   # Print statistics
   virsh -c qemu:///system domjobinfo $VM --completed
-  du -sb $dest | cut -f1
-
-  umount $mount_point
-  rmdir $mount_point
+  backup_size=$(du -sb "$dest" 2>/dev/null | cut -f1) || true
+  
+  timeout 60 umount "$mount_point" 2>/dev/null || true

Review Comment:
   I am ok with this, but can we define 60 as a constant at the top of the file?



##########
scripts/vm/hypervisor/kvm/nasbackup.sh:
##########
@@ -196,10 +196,12 @@ backup_running_vm() {
 
   # Print statistics
   virsh -c qemu:///system domjobinfo $VM --completed
-  du -sb $dest | cut -f1
-
-  umount $mount_point
-  rmdir $mount_point
+  backup_size=$(du -sb "$dest" 2>/dev/null | cut -f1) || true

Review Comment:
   Hi @daviftorres 
   Do we know the exact reason for du to fail? is that a connectivity issue?
   This is the only place where the size is set on the backup. And a 0 size 
will affect resource limit and usage calculations.
   May I suggest adding a retry loop instead?



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