all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Jakob Klocker" <j.klocker@proxmox.com>
To: "Christian Ebner" <c.ebner@proxmox.com>, <pbs-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox-backup v2 1/3] server: pull: run blocking file operations on the blocking pool
Date: Thu, 03 Sep 2026 14:57:20 +0200	[thread overview]
Message-ID: <DL5P5K4C8ZUI.35BFXL1E1QJC1@proxmox.com> (raw)
In-Reply-To: <3d2c267b-e018-4b8e-83c4-665e57ece282@proxmox.com>

On Fri Aug 28, 2026 at 12:30 PM CEST, Christian Ebner wrote:
> One comment inline, with that addressed consider:
>
> Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
>
> On 8/21/26 1:18 PM, Jakob Klocker wrote:
>> [SNIP]
>> +    if let Err(err) = tokio::fs::rename(&source_path, &path).await {
>
> comment: there is an additional std::fs::remove_file() in the pull code, 
> e.g. removing the temp file just above this (not seen in diff). All of 
> these should be moved to tokio::fs::remove_file().
>
> We need to be careful with performance when using tokio::fs over std::fs 
> as stated in [0], but these should be fine to call on the blocking task 
> pool. That this might have performance implications might be also noted 
> in the commit message.
>
> [0] https://docs.rs/tokio/latest/tokio/fs/index.html
>

I'll make sure to replace all existing std::fs::remove_file() with
tokio's version and to adapt the commit message in the next revision.
Since I'm already at it, I'll do so for all occasions in the pull.rs 
file -- std::fs::remove_file is also called twice in
pull_single_archive().

>>           bail!("{archive_prefix}: Atomic rename file {path:?} failed - {err}");
>>       }
>>   
>> @@ -890,7 +890,7 @@ async fn pull_snapshot<'a>(
>>           nix::unistd::fsync(tmp_manifest_file.as_raw_fd())?;
>>       }
>>   
>> -    if let Err(err) = std::fs::rename(&tmp_manifest_name, &manifest_name) {
>> +    if let Err(err) = tokio::fs::rename(&tmp_manifest_name, &manifest_name).await {
>>           bail!("{prefix}: Atomic rename file {manifest_name:?} failed - {err}");
>>       }
>>       if let DatastoreBackend::S3(s3_client) = backend {
>> @@ -910,8 +910,9 @@ async fn pull_snapshot<'a>(
>>   
>>       fetch_log(crypt_config).await?;
>>   
>> -    snapshot
>> -        .cleanup_unreferenced_files(&manifest)
>> +    let snapshot = snapshot.clone();
>> +    tokio::task::spawn_blocking(move || snapshot.cleanup_unreferenced_files(&manifest))
>> +        .await?
>>           .map_err(|err| format_err!("{prefix}: failed to cleanup unreferenced files - {err}"))?;
>>   
>>       Ok(Some(sync_stats))





  reply	other threads:[~2026-09-03 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 11:18 [PATCH proxmox-backup v2 0/3] fix #6990: server: drop verify state on push & pull job Jakob Klocker
2026-08-21 11:18 ` [PATCH proxmox-backup v2 1/3] server: pull: run blocking file operations on the blocking pool Jakob Klocker
2026-08-28 10:30   ` Christian Ebner
2026-09-03 12:57     ` Jakob Klocker [this message]
2026-08-21 11:18 ` [PATCH proxmox-backup v2 2/3] fix #6990: server: drop verify state on push job Jakob Klocker
2026-08-28 10:30   ` Christian Ebner
2026-08-21 11:18 ` [PATCH proxmox-backup v2 3/3] fix #6990: server: drop verify state on non-decrypt pull job Jakob Klocker
2026-08-28 11:11   ` Christian Ebner
2026-09-03 13:59     ` Jakob Klocker
2026-09-04  7:32       ` Christian Ebner

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=DL5P5K4C8ZUI.35BFXL1E1QJC1@proxmox.com \
    --to=j.klocker@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 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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal