all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore
@ 2020-08-04 11:32 Fabian Ebner
  2020-08-04 11:32 ` [pve-devel] [PATCH qemu-server 2/2] Add missing die statements Fabian Ebner
  2020-08-11 12:36 ` [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Grünbichler
  0 siblings, 2 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-08-04 11:32 UTC (permalink / raw)
  To: pve-devel

qcow2 images are allocated with --preallocation=metadata,
which can take a while for large images.
Avoid using 'got timeout' as an error message by itself,
to make it clearer where a timeout occured.

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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0a09f3a..8b0b2c8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6261,7 +6261,7 @@ sub restore_vma_archive {
 	    local $SIG{QUIT} =
 	    local $SIG{HUP} =
 	    local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
-	local $SIG{ALRM} = sub { die "got timeout\n"; };
+	local $SIG{ALRM} = sub { die "got timeout preparing device images\n"; };
 
 	$oldtimeout = alarm($timeout);
 
@@ -6275,9 +6275,9 @@ 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
+		# the timeout now for disk allocation (set to 1 hour, so
 		# that we always timeout if something goes wrong)
-		alarm(600);
+		alarm(60 * 60);
 		&$print_devmap();
 		print $fifofh "done\n";
 		my $tmp = $oldtimeout || 0;
-- 
2.20.1





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

* [pve-devel] [PATCH qemu-server 2/2] Add missing die statements
  2020-08-04 11:32 [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Ebner
@ 2020-08-04 11:32 ` Fabian Ebner
  2020-08-11 12:35   ` [pve-devel] applied: " Fabian Grünbichler
  2020-08-11 12:36 ` [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Grünbichler
  1 sibling, 1 reply; 5+ messages in thread
From: Fabian Ebner @ 2020-08-04 11:32 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8b0b2c8..11de6d4 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6022,7 +6022,7 @@ sub restore_proxmox_backup_archive {
 	}
 
 	my $fh = IO::File->new($cfgfn, "r") ||
-	    "unable to read qemu-server.conf - $!\n";
+	    die "unable to read qemu-server.conf - $!\n";
 
 	my $virtdev_hash = $parse_backup_hints->($rpcenv, $user, $storecfg, $fh, $devinfo, $options);
 
@@ -6183,7 +6183,7 @@ sub restore_vma_archive {
 
 	# we can read the config - that is already extracted
 	my $fh = IO::File->new($cfgfn, "r") ||
-	    "unable to read qemu-server.conf - $!\n";
+	    die "unable to read qemu-server.conf - $!\n";
 
 	my $fwcfgfn = "$tmpdir/qemu-server.fw";
 	if (-f $fwcfgfn) {
-- 
2.20.1





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

* [pve-devel] applied: [PATCH qemu-server 2/2] Add missing die statements
  2020-08-04 11:32 ` [pve-devel] [PATCH qemu-server 2/2] Add missing die statements Fabian Ebner
@ 2020-08-11 12:35   ` Fabian Grünbichler
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Grünbichler @ 2020-08-11 12:35 UTC (permalink / raw)
  To: Proxmox VE development discussion

On August 4, 2020 1:32 pm, Fabian Ebner wrote:
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/QemuServer.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 8b0b2c8..11de6d4 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -6022,7 +6022,7 @@ sub restore_proxmox_backup_archive {
>  	}
>  
>  	my $fh = IO::File->new($cfgfn, "r") ||
> -	    "unable to read qemu-server.conf - $!\n";
> +	    die "unable to read qemu-server.conf - $!\n";
>  
>  	my $virtdev_hash = $parse_backup_hints->($rpcenv, $user, $storecfg, $fh, $devinfo, $options);
>  
> @@ -6183,7 +6183,7 @@ sub restore_vma_archive {
>  
>  	# we can read the config - that is already extracted
>  	my $fh = IO::File->new($cfgfn, "r") ||
> -	    "unable to read qemu-server.conf - $!\n";
> +	    die "unable to read qemu-server.conf - $!\n";
>  
>  	my $fwcfgfn = "$tmpdir/qemu-server.fw";
>  	if (-f $fwcfgfn) {
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




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

* Re: [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore
  2020-08-04 11:32 [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Ebner
  2020-08-04 11:32 ` [pve-devel] [PATCH qemu-server 2/2] Add missing die statements Fabian Ebner
@ 2020-08-11 12:36 ` Fabian Grünbichler
  2020-08-12  8:38   ` Fabian Ebner
  1 sibling, 1 reply; 5+ messages in thread
From: Fabian Grünbichler @ 2020-08-11 12:36 UTC (permalink / raw)
  To: Proxmox VE development discussion

On August 4, 2020 1:32 pm, Fabian Ebner wrote:
> qcow2 images are allocated with --preallocation=metadata,
> which can take a while for large images.
> Avoid using 'got timeout' as an error message by itself,
> to make it clearer where a timeout occured.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/QemuServer.pm | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 0a09f3a..8b0b2c8 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -6261,7 +6261,7 @@ sub restore_vma_archive {
>  	    local $SIG{QUIT} =
>  	    local $SIG{HUP} =
>  	    local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
> -	local $SIG{ALRM} = sub { die "got timeout\n"; };
> +	local $SIG{ALRM} = sub { die "got timeout preparing device images\n"; };
>  
>  	$oldtimeout = alarm($timeout);
>  
> @@ -6275,9 +6275,9 @@ 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
> +		# the timeout now for disk allocation (set to 1 hour, so
>  		# that we always timeout if something goes wrong)

do we really need this timeout? we are by definition in a worker 
already, instead of moving the goal post once more could we not drop 
this and let the user hit 'Stop' if the allocation stalls altogether?

> -		alarm(600);
> +		alarm(60 * 60);
>  		&$print_devmap();
>  		print $fifofh "done\n";
>  		my $tmp = $oldtimeout || 0;
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




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

* Re: [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore
  2020-08-11 12:36 ` [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Grünbichler
@ 2020-08-12  8:38   ` Fabian Ebner
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-08-12  8:38 UTC (permalink / raw)
  To: pve-devel

Am 11.08.20 um 14:36 schrieb Fabian Grünbichler:
> On August 4, 2020 1:32 pm, Fabian Ebner wrote:
>> qcow2 images are allocated with --preallocation=metadata,
>> which can take a while for large images.
>> Avoid using 'got timeout' as an error message by itself,
>> to make it clearer where a timeout occured.
>>
>> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
>> ---
>>   PVE/QemuServer.pm | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
>> index 0a09f3a..8b0b2c8 100644
>> --- a/PVE/QemuServer.pm
>> +++ b/PVE/QemuServer.pm
>> @@ -6261,7 +6261,7 @@ sub restore_vma_archive {
>>   	    local $SIG{QUIT} =
>>   	    local $SIG{HUP} =
>>   	    local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
>> -	local $SIG{ALRM} = sub { die "got timeout\n"; };
>> +	local $SIG{ALRM} = sub { die "got timeout preparing device images\n"; };
>>   
>>   	$oldtimeout = alarm($timeout);

^[0]

>>   
>> @@ -6275,9 +6275,9 @@ 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
>> +		# the timeout now for disk allocation (set to 1 hour, so
>>   		# that we always timeout if something goes wrong)
> 
> do we really need this timeout? we are by definition in a worker
> already, instead of moving the goal post once more could we not drop
> this and let the user hit 'Stop' if the allocation stalls altogether?
> 

I thought we'd need the timeout here, because otherwise the timeout from 
above[0] is still active. This also seems to be the reason the timeout 
was introduced in the first place with 
3cf90d7a40554b4c353e389209d6ef36a89b96a7

But of course we could move the alarm($oldtimeout || 0) to before 
&$print_devmap(). If we do this, then the time spent allocating the 
disks will eat into the oldtimeout.

That said, oldtimeout should always be 0 anyways, because AFAICT the 
only path leading here is:
API-create_vm -> *spawning of worker* -> restore_file_archive -> 
restore_vma_archive
and nobody sets an alarm along the way.

I'll send a v2.

>> -		alarm(600);
>> +		alarm(60 * 60);
>>   		&$print_devmap();
>>   		print $fifofh "done\n";
>>   		my $tmp = $oldtimeout || 0;
>> -- 
>> 2.20.1
>>
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel@lists.proxmox.com
>> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>>
>>
>>
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




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

end of thread, other threads:[~2020-08-12  8:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 11:32 [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Ebner
2020-08-04 11:32 ` [pve-devel] [PATCH qemu-server 2/2] Add missing die statements Fabian Ebner
2020-08-11 12:35   ` [pve-devel] applied: " Fabian Grünbichler
2020-08-11 12:36 ` [pve-devel] [PATCH qemu-server 1/2] Fix #2816: increase timeout for allocation on restore Fabian Grünbichler
2020-08-12  8:38   ` Fabian Ebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal