From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload
Date: Fri, 22 Aug 2025 10:04:14 +0200 [thread overview]
Message-ID: <20250822080414.104200-1-c.ebner@proxmox.com> (raw)
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@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
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next reply other threads:[~2025-08-22 8:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 8:04 Christian Ebner [this message]
2025-08-25 7:29 ` [pbs-devel] applied: " 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=20250822080414.104200-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.