all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage v4 2/3] api: FileRestore: make use of file-restores and guis timeout mechanism
Date: Thu, 10 Nov 2022 11:36:33 +0100	[thread overview]
Message-ID: <20221110103634.2177856-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221110103634.2177856-1-d.csapak@proxmox.com>

file-restore has a 'timeout' parameter and if that is exceeded, returns
an error with the http code 503 Service Unavailable

When the web ui encounters such an error, it retries the listing a few
times before giving up.

To make use of these, add the 'timeout' parameter to the new
'extraParams' of 'file_restore_list'.

25 seconds are chosen because it's under pveproxy 30s limit, with a bit
of overhead to spare for the rest of the api call, like json decoding,
forking, access control checks, etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
new in v4
depends on pve-common 1/2

 PVE/API2/Storage/FileRestore.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Storage/FileRestore.pm b/PVE/API2/Storage/FileRestore.pm
index 4033136..764ebfb 100644
--- a/PVE/API2/Storage/FileRestore.pm
+++ b/PVE/API2/Storage/FileRestore.pm
@@ -119,7 +119,7 @@ __PACKAGE__->register_method ({
 	my (undef, $snap) = PVE::Storage::parse_volname($cfg, $volid);
 
 	my $client = PVE::PBSClient->new($scfg, $storeid);
-	my $ret = $client->file_restore_list($snap, $path, $base64);
+	my $ret = $client->file_restore_list($snap, $path, $base64, { timeout => 25 });
 
 	if (ref($ret) eq "HASH") {
 	    my $msg = $ret->{message};
-- 
2.30.2





WARNING: multiple messages have this Message-ID
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH storage v4 2/3] api: FileRestore: make use of file-restores and guis timeout mechanism
Date: Thu, 10 Nov 2022 11:36:33 +0100	[thread overview]
Message-ID: <20221110103634.2177856-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221110103634.2177856-1-d.csapak@proxmox.com>

file-restore has a 'timeout' parameter and if that is exceeded, returns
an error with the http code 503 Service Unavailable

When the web ui encounters such an error, it retries the listing a few
times before giving up.

To make use of these, add the 'timeout' parameter to the new
'extraParams' of 'file_restore_list'.

25 seconds are chosen because it's under pveproxy 30s limit, with a bit
of overhead to spare for the rest of the api call, like json decoding,
forking, access control checks, etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
new in v4
depends on pve-common 1/2

 PVE/API2/Storage/FileRestore.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Storage/FileRestore.pm b/PVE/API2/Storage/FileRestore.pm
index 4033136..764ebfb 100644
--- a/PVE/API2/Storage/FileRestore.pm
+++ b/PVE/API2/Storage/FileRestore.pm
@@ -119,7 +119,7 @@ __PACKAGE__->register_method ({
 	my (undef, $snap) = PVE::Storage::parse_volname($cfg, $volid);
 
 	my $client = PVE::PBSClient->new($scfg, $storeid);
-	my $ret = $client->file_restore_list($snap, $path, $base64);
+	my $ret = $client->file_restore_list($snap, $path, $base64, { timeout => 25 });
 
 	if (ref($ret) eq "HASH") {
 	    my $msg = $ret->{message};
-- 
2.30.2





  parent reply	other threads:[~2022-11-10 10:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 10:36 [pve-devel] [PATCH proxmox-backup/common/storage v4] improve file-restore timeout behaviour Dominik Csapak
2022-11-10 10:36 ` [pbs-devel] " Dominik Csapak
2022-11-10 10:36 ` [pve-devel] [PATCH proxmox-backup v4 1/1] file-restore: make dynamic memory behaviour controllable Dominik Csapak
2022-11-10 10:36   ` [pbs-devel] " Dominik Csapak
2022-11-15  8:29   ` [pve-devel] applied: " Thomas Lamprecht
2022-11-15  8:29     ` [pbs-devel] applied: " Thomas Lamprecht
2022-11-10 10:36 ` [pve-devel] [PATCH common v4 1/2] PBSClient: file_restore_list: add extraParams and use timeout Dominik Csapak
2022-11-10 10:36   ` [pbs-devel] " Dominik Csapak
2022-11-15 12:27   ` [pve-devel] applied: " Thomas Lamprecht
2022-11-15 12:27     ` [pbs-devel] applied: [pve-devel] " Thomas Lamprecht
2022-11-10 10:36 ` [pve-devel] [PATCH common v4 2/2] PBSClient: add optional 'dynamic-memory' parameter to file-restore commands Dominik Csapak
2022-11-10 10:36   ` [pbs-devel] " Dominik Csapak
2022-11-10 10:36 ` [pve-devel] [PATCH storage v4 1/3] api: FileRestore: decode and return proper error of file-restore listing Dominik Csapak
2022-11-10 10:36   ` [pbs-devel] " Dominik Csapak
2022-11-15 12:27   ` [pve-devel] applied: " Thomas Lamprecht
2022-11-15 12:27     ` [pbs-devel] applied: [pve-devel] " Thomas Lamprecht
2022-11-10 10:36 ` Dominik Csapak [this message]
2022-11-10 10:36   ` [pbs-devel] [PATCH storage v4 2/3] api: FileRestore: make use of file-restores and guis timeout mechanism Dominik Csapak
2022-11-15 12:28   ` [pve-devel] applied: " Thomas Lamprecht
2022-11-15 12:28     ` [pbs-devel] applied: [pve-devel] " Thomas Lamprecht
2022-11-10 10:36 ` [pve-devel] [PATCH storage v4 3/3] api: FileRestore: allow automatic memory increase for privileged users Dominik Csapak
2022-11-10 10:36   ` [pbs-devel] " Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221110103634.2177856-6-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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