[pbs-devel] [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload

Christian Ebner c.ebner at proxmox.com
Fri Aug 22 10:04:14 CEST 2025


The api handler for backup task uploads is an async handler,
therefore blocking via proxmox_async::runtime::block_on() is fatal
as will lead to blocking of the current thread, not allowing any
other future to make progress.

Fix this by simply await the s3 api request future instead, as the
api handler is already executed in an async context.

Fixes: https://forum.proxmox.com/threads/169589/
Fixes: a97b2378 ("api: datastore: conditionally upload client log to s3 backend")
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
Note:
While this fixes the blocking, it does not fix the upload request timeout which
probably leads to this hanging forever for most users. The timeout is adapted by
https://lore.proxmox.com/pbs-devel/20250820095807.172722-1-c.ebner@proxmox.com/T/

 src/api2/admin/datastore.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 07e2f928b..a098aca8e 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1532,7 +1532,9 @@ pub fn upload_backup_log(
             )
             .context("invalid client log object key")?;
             let data = hyper::body::Bytes::copy_from_slice(blob.raw_data());
-            proxmox_async::runtime::block_on(s3_client.upload_replace_with_retry(object_key, data))
+            s3_client
+                .upload_replace_with_retry(object_key, data)
+                .await
                 .context("failed to upload client log to s3 backend")?;
         };
 
-- 
2.47.2





More information about the pbs-devel mailing list