public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH proxmox-backup] fix: api: do not block current thread during s3 backup log upload
Date: Mon, 25 Aug 2025 09:29:46 +0200	[thread overview]
Message-ID: <fh6h62y32ti2ckvnzungpve5yv5xjhebnfvfrql5dkdmls2n77@thyxengw4wjf> (raw)
In-Reply-To: <20250822080414.104200-1-c.ebner@proxmox.com>

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


      reply	other threads:[~2025-08-25  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22  8:04 [pbs-devel] " Christian Ebner
2025-08-25  7:29 ` Wolfgang Bumiller [this message]

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=fh6h62y32ti2ckvnzungpve5yv5xjhebnfvfrql5dkdmls2n77@thyxengw4wjf \
    --to=w.bumiller@proxmox.com \
    --cc=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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal