From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 176827342F;
 Fri, 27 May 2022 10:22:08 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 0E5ACB3FE;
 Fri, 27 May 2022 10:22:08 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 1F4B2B3E9;
 Fri, 27 May 2022 10:22:04 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DD7F8438B6;
 Fri, 27 May 2022 10:22:03 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com,
	pbs-devel@lists.proxmox.com
Date: Fri, 27 May 2022 10:22:00 +0200
Message-Id: <20220527082203.1653182-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.113 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pve-devel] [PATCH common/storage/proxmxo-backup v3] improve
 file-restore timeout behaviour
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 27 May 2022 08:22:08 -0000

this series improves the behaviour of the file-restore when some mount
operations take longer than the 30 second pveproxy timeout

some of the previous version was already applied (pbs + gui) so only
the pve part is still missing

i changed the way we return the error a bit from my previous (and
already applied) attempt, namely i couple how we return the error
on the 'output-format' instead of a seperate 'json-error'

while this is technically a change in behaviour, this is imho ok because:
* setting 'output-format' to json(-pretty) did not format the error,
  so a tool would have to cope with the pure text
* AFAIK we don't have the same guarantees for the cli as for the api
* it's a much better interface than before

but since this changed, and the 'json-error' was already applied,
the dependencies go as follows:

pve-storage depends on the new proxmox-backup-file-restore/pve-common
to work properly, but it's not broken with the current versions
proxmox-backup breaks the current pve-storage (so that we must bump and
add a 'breaks <<' probably)

the gui should already handle the new code, so that is fine either way

changes from v2:
* couple the error format to 'ouput-format' instead of 'json-error'
* remove 'error' property from 'error json object' (was redundant)
* always expect an error when we get an object and always treat
  it as ok when we get a list

changes from v1:
* rebased on master
* moved the json-error and timeout directly into pve-common (hardcoded)
  since there is only one usage of that function


pve-common:

Dominik Csapak (1):
  PBSClient: file_restore_list: add timeout parameter

 src/PVE/PBSClient.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

pve-storage:

Dominik Csapak (1):
  api: FileRestore: decode and return proper error with new file-restore
    params

 PVE/API2/Storage/FileRestore.pm | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

proxmox-backup:

Dominik Csapak (1):
  file-restore: remove 'json-error' parameter  from list_files

 proxmox-file-restore/src/main.rs | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.30.2