* [pbs-devel] [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload
@ 2025-08-22 8:04 Christian Ebner
2025-08-25 7:29 ` [pbs-devel] applied: " Wolfgang Bumiller
0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2025-08-22 8:04 UTC (permalink / raw)
To: pbs-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload
2025-08-22 8:04 [pbs-devel] [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload Christian Ebner
@ 2025-08-25 7:29 ` Wolfgang Bumiller
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-08-25 7:29 UTC (permalink / raw)
To: Christian Ebner; +Cc: pbs-devel
applied, thanks
On Fri, Aug 22, 2025 at 10:04:14AM +0200, Christian Ebner wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-25 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-22 8:04 [pbs-devel] [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload Christian Ebner
2025-08-25 7:29 ` [pbs-devel] applied: " Wolfgang Bumiller
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.