public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] fix #4189: pbs: bump list_volumes timeout to 2mins
@ 2022-08-17 10:32 Wolfgang Bumiller
  2022-08-17 11:16 ` [pve-devel] applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfgang Bumiller @ 2022-08-17 10:32 UTC (permalink / raw)
  To: pve-devel

When switching this from calling the external binary to
using the perl api client the timeout got reduced to 7
seconds, which is definitely insufficient for larger stores.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 PVE/Storage/PBSPlugin.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm
index afc6ea4..603529f 100644
--- a/PVE/Storage/PBSPlugin.pm
+++ b/PVE/Storage/PBSPlugin.pm
@@ -688,7 +688,7 @@ my sub snapshot_files_encrypted {
 # TODO: use a client with native rust/proxmox-backup bindings to profit from
 # API schema checks and types
 my sub pbs_api_connect {
-    my ($scfg, $password) = @_;
+    my ($scfg, $password, $timeout) = @_;
 
     my $params = {};
 
@@ -709,7 +709,7 @@ my sub pbs_api_connect {
 	%$params,
 	host => $scfg->{server},
 	port => $scfg->{port} // 8007,
-	timeout => 7, # cope with a 401 (3s api delay) and high latency
+	timeout => ($timeout // 7), # cope with a 401 (3s api delay) and high latency
 	cookie_name => 'PBSAuthCookie',
     );
 
@@ -724,7 +724,7 @@ sub list_volumes {
     return $res if !grep { $_ eq 'backup' } @$content_types;
 
     my $password = pbs_get_password($scfg, $storeid);
-    my $conn = pbs_api_connect($scfg, $password);
+    my $conn = pbs_api_connect($scfg, $password, 120);
     my $datastore = $scfg->{datastore};
 
     my $param = {};
-- 
2.30.2





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

* [pve-devel] applied: [PATCH storage] fix #4189: pbs: bump list_volumes timeout to 2mins
  2022-08-17 10:32 [pve-devel] [PATCH storage] fix #4189: pbs: bump list_volumes timeout to 2mins Wolfgang Bumiller
@ 2022-08-17 11:16 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2022-08-17 11:16 UTC (permalink / raw)
  To: Proxmox VE development discussion

thanks!

On August 17, 2022 12:32 pm, Wolfgang Bumiller wrote:
> When switching this from calling the external binary to
> using the perl api client the timeout got reduced to 7
> seconds, which is definitely insufficient for larger stores.
> 
> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> ---
>  PVE/Storage/PBSPlugin.pm | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm
> index afc6ea4..603529f 100644
> --- a/PVE/Storage/PBSPlugin.pm
> +++ b/PVE/Storage/PBSPlugin.pm
> @@ -688,7 +688,7 @@ my sub snapshot_files_encrypted {
>  # TODO: use a client with native rust/proxmox-backup bindings to profit from
>  # API schema checks and types
>  my sub pbs_api_connect {
> -    my ($scfg, $password) = @_;
> +    my ($scfg, $password, $timeout) = @_;
>  
>      my $params = {};
>  
> @@ -709,7 +709,7 @@ my sub pbs_api_connect {
>  	%$params,
>  	host => $scfg->{server},
>  	port => $scfg->{port} // 8007,
> -	timeout => 7, # cope with a 401 (3s api delay) and high latency
> +	timeout => ($timeout // 7), # cope with a 401 (3s api delay) and high latency
>  	cookie_name => 'PBSAuthCookie',
>      );
>  
> @@ -724,7 +724,7 @@ sub list_volumes {
>      return $res if !grep { $_ eq 'backup' } @$content_types;
>  
>      my $password = pbs_get_password($scfg, $storeid);
> -    my $conn = pbs_api_connect($scfg, $password);
> +    my $conn = pbs_api_connect($scfg, $password, 120);
>      my $datastore = $scfg->{datastore};
>  
>      my $param = {};
> -- 
> 2.30.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




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

end of thread, other threads:[~2022-08-17 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 10:32 [pve-devel] [PATCH storage] fix #4189: pbs: bump list_volumes timeout to 2mins Wolfgang Bumiller
2022-08-17 11:16 ` [pve-devel] applied: " Fabian Grünbichler

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