Re: [PATCH proxmox-backup v3 26/30] sync: pull: decrypt blob files on pull if encryption key is configured

Thomas Lamprecht
2026-04-19T21:08:30Z

Am 14.04.26 um 14:59 schrieb Christian Ebner:
> diff --git a/src/server/pull.rs b/src/server/pull.rs
> @@ -409,6 +413,57 @@ async fn pull_single_archive<'a>(
>
> + let mut decrypted_tmpfile = std::fs::OpenOptions::new()
> + .read(true)
> + .write(true)
> + .create_new(true)
> + .open(&decrypted_tmp_path)?;

create_new(true) will fail permanently if a previous run got killed between
creating the .dectmp file and the cleanup at the end of the try_block (which
only runs on Rust-level errors, not on SIGKILL or power loss). On the next
sync attempt the stale .dectmp file causes an EEXIST error with no way to
self-recover.

Either using .create(true).truncate(true) instead should make retries work
by just overwriting any stale leftover or clean those files up in some other
way (on failure) might make this a bit more robust with temporarily outages.