From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] s3: pass now optional default request timeout for s3 api calls
Date: Wed, 20 Aug 2025 11:58:06 +0200 [thread overview]
Message-ID: <20250820095807.172722-5-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250820095807.172722-1-c.ebner@proxmox.com>
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 <c.ebner@proxmox.com>
---
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
next prev parent reply other threads:[~2025-08-20 9:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 9:58 [pbs-devel] [PATCH proxmox{, -backup} 0/5] dynamically calculate request timeout for put object calls Christian Ebner
2025-08-20 9:58 ` [pbs-devel] [PATCH proxmox 1/3] s3-client: allow setting custom timeout when sending requests Christian Ebner
2025-08-20 9:58 ` [pbs-devel] [PATCH proxmox 2/3] s3-client: dynamically calculate put request timeout based on payload Christian Ebner
2025-08-20 9:58 ` [pbs-devel] [PATCH proxmox 3/3] s3-client: expose default timeout for s3 api requests Christian Ebner
2025-08-20 9:58 ` Christian Ebner [this message]
2025-08-20 9:58 ` [pbs-devel] [PATCH proxmox-backup 2/2] api: format error to show full context for failed chunk uploads Christian Ebner
2025-08-25 9:35 ` [pbs-devel] applied-series: [PATCH proxmox{, -backup} 0/5] dynamically calculate request timeout for put object calls Wolfgang Bumiller
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=20250820095807.172722-5-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox