public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer
@ 2024-03-06 14:04 Dominik Csapak
  2024-03-06 14:04 ` [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Dominik Csapak
  2024-03-06 14:04 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes Dominik Csapak
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2024-03-06 14:04 UTC (permalink / raw)
  To: pbs-devel

the gui api calls have a default timeout of 30 seconds, which is too
short for a transfer of tapes with real world hardware.

introduce extra options for the edit window and use that to set an
increased timeout for transfers.

proxmox-widget-toolkit:

Dominik Csapak (1):
  edit window: add optional custom submit options

 src/window/Edit.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

proxmox-backup:

Dominik Csapak (1):
  ui: tape: transfer: increase timeout to 3 minutes

 www/tape/ChangerStatus.js | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.39.2





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

* [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options
  2024-03-06 14:04 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer Dominik Csapak
@ 2024-03-06 14:04 ` Dominik Csapak
  2024-03-07 14:22   ` [pbs-devel] applied: " Thomas Lamprecht
  2024-03-06 14:04 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes Dominik Csapak
  1 sibling, 1 reply; 4+ messages in thread
From: Dominik Csapak @ 2024-03-06 14:04 UTC (permalink / raw)
  To: pbs-devel

sometimes it's necessary or handy to add custom options to the submit
api call (e.g. timeout). So just expose a `submitOptions` where users
of the edit window can put their custom options.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/window/Edit.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/window/Edit.js b/src/window/Edit.js
index 7f94e30..d4a2b55 100644
--- a/src/window/Edit.js
+++ b/src/window/Edit.js
@@ -31,6 +31,9 @@ Ext.define('Proxmox.window.Edit', {
     // custom submitText
     submitText: undefined,
 
+    // custom options for the submit api call
+    submitOptions: {},
+
     backgroundDelay: 0,
 
     // string or function, called as (url, values) - useful if the ID of the
@@ -151,7 +154,7 @@ Ext.define('Proxmox.window.Edit', {
 	    values = undefined;
 	}
 
-	Proxmox.Utils.API2Request({
+	let requestOptions = Ext.apply({
 	    url: url,
 	    waitMsgTarget: me,
 	    method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
@@ -191,7 +194,8 @@ Ext.define('Proxmox.window.Edit', {
 		    me.close();
 		}
 	    },
-	});
+	}, me.submitOptions ?? {});
+	Proxmox.Utils.API2Request(requestOptions);
     },
 
     load: function(options) {
-- 
2.39.2





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

* [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes
  2024-03-06 14:04 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer Dominik Csapak
  2024-03-06 14:04 ` [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Dominik Csapak
@ 2024-03-06 14:04 ` Dominik Csapak
  1 sibling, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2024-03-06 14:04 UTC (permalink / raw)
  To: pbs-devel

the default timeout of 30 seconds is too short to properly wait for a
slot transfer. Increase the timeout to a value of 3 minutes. In my
tests, it took about 60 seconds in a very basic changer to move a tape
between two slots, so triple that to account for bigger and more
complicated libraries.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/tape/ChangerStatus.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index 27c7605c..fdafc459 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -60,6 +60,9 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		submitText: gettext('OK'),
 		method: 'POST',
 		url: `/api2/extjs/tape/changer/${changer}/transfer`,
+		submitOptions: {
+		    timeout: 3*60*1000,
+		},
 		items: [
 		    {
 			xtype: 'displayfield',
@@ -96,6 +99,9 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		submitText: gettext('OK'),
 		method: 'POST',
 		url: `/api2/extjs/tape/changer/${changer}/transfer`,
+		submitOptions: {
+		    timeout: 3*60*1000,
+		},
 		items: [
 		    {
 			xtype: 'displayfield',
-- 
2.39.2





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

* [pbs-devel] applied: [PATCH widget-toolkit 1/1] edit window: add optional custom submit options
  2024-03-06 14:04 ` [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Dominik Csapak
@ 2024-03-07 14:22   ` Thomas Lamprecht
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-03-07 14:22 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

Am 06/03/2024 um 15:04 schrieb Dominik Csapak:
> sometimes it's necessary or handy to add custom options to the submit
> api call (e.g. timeout). So just expose a `submitOptions` where users
> of the edit window can put their custom options.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/window/Edit.js | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

applied, thanks!

> @@ -151,7 +154,7 @@ Ext.define('Proxmox.window.Edit', {
>  	    values = undefined;
>  	}
>  
> -	Proxmox.Utils.API2Request({
> +	let requestOptions = Ext.apply({
>  	    url: url,
>  	    waitMsgTarget: me,
>  	    method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
> @@ -191,7 +194,8 @@ Ext.define('Proxmox.window.Edit', {
>  		    me.close();
>  		}
>  	    },
> -	});
> +	}, me.submitOptions ?? {});
> +	Proxmox.Utils.API2Request(requestOptions);

I thought about using the spread operator, i.e. something like:

Proxmox.Utils.API2Request({
   url: url,
   // and so on
   ...(me.submitOptions ?? {})
});

but it doesn't really has much advantage besides being more modern syntax,
which on it's own is not a good justification, so I ignored the itch to
adapt this ^^




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

end of thread, other threads:[~2024-03-07 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 14:04 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer Dominik Csapak
2024-03-06 14:04 ` [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Dominik Csapak
2024-03-07 14:22   ` [pbs-devel] applied: " Thomas Lamprecht
2024-03-06 14:04 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes Dominik Csapak

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