From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5D0741FF17C for ; Wed, 20 Aug 2025 11:57:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6BA9137713; Wed, 20 Aug 2025 11:58:53 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 20 Aug 2025 11:58:06 +0200 Message-ID: <20250820095807.172722-5-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250820095807.172722-1-c.ebner@proxmox.com> References: <20250820095807.172722-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1755683855827 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.044 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 Subject: [pbs-devel] [PATCH proxmox-backup 1/2] s3: pass now optional default request timeout for s3 api calls X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" The request timeout is now exposed as optional duration to the put object s3 api calls, so it can be dynamically adapted based on the payload size when uploading objects via the respective helper methods. Adapt the remaining direct call sites to use the previous default, given their limited payload size. Signed-off-by: Christian Ebner --- src/api2/admin/s3.rs | 9 +++++++-- src/api2/config/datastore.rs | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api2/admin/s3.rs b/src/api2/admin/s3.rs index 209feaebc..73f3779a5 100644 --- a/src/api2/admin/s3.rs +++ b/src/api2/admin/s3.rs @@ -7,7 +7,7 @@ use proxmox_http::Body; use proxmox_router::{list_subdirs_api_method, Permission, Router, RpcEnvironment, SubdirMap}; use proxmox_s3_client::{ S3Client, S3ClientConf, S3ClientOptions, S3ObjectKey, S3_BUCKET_NAME_SCHEMA, - S3_CLIENT_ID_SCHEMA, + S3_CLIENT_ID_SCHEMA, S3_HTTP_REQUEST_TIMEOUT, }; use proxmox_schema::*; use proxmox_sortable_macro::sortable; @@ -57,7 +57,12 @@ pub async fn check( let client = S3Client::new(options).context("client creation failed")?; client.head_bucket().await.context("head object failed")?; client - .put_object(test_object_key.clone(), Body::empty(), true) + .put_object( + test_object_key.clone(), + Body::empty(), + Some(S3_HTTP_REQUEST_TIMEOUT), + true, + ) .await .context("put object failed")?; client diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs index 5b9fcd9da..e86ded0db 100644 --- a/src/api2/config/datastore.rs +++ b/src/api2/config/datastore.rs @@ -36,7 +36,7 @@ use pbs_datastore::{ get_datastore_mount_status, DataStore, DatastoreBackend, S3_DATASTORE_IN_USE_MARKER, }; use proxmox_rest_server::WorkerTask; -use proxmox_s3_client::S3ObjectKey; +use proxmox_s3_client::{S3ObjectKey, S3_HTTP_REQUEST_TIMEOUT}; use crate::server::jobstate; use crate::tools::disks::unmount_by_mountpoint; @@ -217,6 +217,7 @@ pub(crate) fn do_create_datastore( proxmox_async::runtime::block_on(s3_client.put_object( object_key, hyper::body::Bytes::from(content).into(), + Some(S3_HTTP_REQUEST_TIMEOUT), true, )) .context("failed to upload in-use marker for datastore")?; -- 2.47.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel