public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2] sync job: pull: avoid blocking future during thread pool completion
Date: Tue, 14 Oct 2025 13:54:29 +0200	[thread overview]
Message-ID: <20251014115429.495501-1-c.ebner@proxmox.com> (raw)

Chunk insertion during a pull sync job is performed via a thread pool
to increase performance. The caller waits for all threads to be
completed at the end, relying on the respective associated threads to
return from `std::thread::JoinHandle::join`.

Insertion into the chunk store can however take time, especially
for chunks being uploaded to the object store for datastores with
S3 backend.

To avoid blocking the async runtime, spawn a dedicated task to await
the thread pool completion.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 1:
- fix incorrect error handling

 src/server/pull.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/server/pull.rs b/src/server/pull.rs
index 08e6e6b64..817b57ac5 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -232,7 +232,7 @@ async fn pull_index_chunks<I: IndexFile>(
 
     drop(verify_and_write_channel);
 
-    verify_pool.complete()?;
+    tokio::task::spawn_blocking(|| verify_pool.complete()).await??;
 
     let elapsed = start_time.elapsed()?;
 
-- 
2.47.3



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


             reply	other threads:[~2025-10-14 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 11:54 Christian Ebner [this message]
2025-10-14 13:05 ` [pbs-devel] applied: " Fabian Grünbichler

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=20251014115429.495501-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 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