public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/3] fix #2816: restore: remove timeout when allocating disks
@ 2023-09-12  9:16 Fiona Ebner
  2023-09-12  9:16 ` [pve-devel] [PATCH qemu-server 2/3] restore vma: add comment describing timeout Fiona Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Fiona Ebner @ 2023-09-12  9:16 UTC (permalink / raw)
  To: pve-devel

10 minutes is not long enough when disks are large and/or network
storages are used when preallocation is not disabled. The default is
metadata preallocation for qcow2, so there are still reports of the
issue [0][1]. If allocation really does not finish like the comment
describing the timeout feared, just let the user cancel it.

Also note that when restoring a PBS backup, there is no timeout for
disk allocation, and there don't seem to be any user complaints yet.

The 5 second timeout for receiving the config from vma is kept,
because certain corruptions in the VMA header can lead to the
operation hanging there.

There is no need for the $tmp variable before setting back the old
timeout, because that is at least one second, so we'll always be able
to set the $oldtimeout variable to undef in time in practice.
Currently, there shouldn't even be an outer timeout in the first
place, because the only call path leading to here is via the create
API (also used by qmrestore), both of which don't set a timeout.

[0]: https://forum.proxmox.com/threads/126825/
[1]: https://forum.proxmox.com/threads/128093/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bf1de179..05283562 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7483,14 +7483,11 @@ sub restore_vma_archive {
 		$devinfo->{$devname} = { size => $size, dev_id => $dev_id };
 	    } elsif ($line =~ m/^CTIME: /) {
 		# we correctly received the vma config, so we can disable
-		# the timeout now for disk allocation (set to 10 minutes, so
-		# that we always timeout if something goes wrong)
-		alarm(600);
+		# the timeout now for disk allocation
+		alarm($oldtimeout || 0);
+		$oldtimeout = undef;
 		&$print_devmap();
 		print $fifofh "done\n";
-		my $tmp = $oldtimeout || 0;
-		$oldtimeout = undef;
-		alarm($tmp);
 		close($fifofh);
 		$fifofh = undef;
 	    }
-- 
2.39.2





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-11-17  8:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12  9:16 [pve-devel] [PATCH qemu-server 1/3] fix #2816: restore: remove timeout when allocating disks Fiona Ebner
2023-09-12  9:16 ` [pve-devel] [PATCH qemu-server 2/3] restore vma: add comment describing timeout Fiona Ebner
2023-09-12  9:16 ` [pve-devel] [PATCH qemu-server 3/3] restore vma: inline one timeout variable and move other closer to usage Fiona Ebner
2023-09-20 11:23 ` [pve-devel] [PATCH qemu-server 1/3] fix #2816: restore: remove timeout when allocating disks Dominik Csapak
2023-09-20 11:28   ` Dominik Csapak
2023-09-25  8:46   ` Fiona Ebner
2023-09-25  8:57     ` Dominik Csapak
2023-09-25 10:30       ` Fiona Ebner
2023-09-25 11:25         ` Dominik Csapak
2023-11-17  8:49 ` [pve-devel] applied-series: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal