From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup] api: backup: cleanup backup group created by benchmark
Date: Thu, 30 Apr 2026 15:59:31 +0200 [thread overview]
Message-ID: <20260430135931.722979-1-c.ebner@proxmox.com> (raw)
The benchmark creates it's own backup group host/benchmark, failed
however to auto-cleanup the group after itself, because since commit
23be00a42 ("fix #3336: datastore: remove group if the last snapshot
is removed"), cleanup requires an exclusive lock on the backup group
for destroying it. The backup environment however already holds the
exclusive lock to disallow concurrent backups to the same group.
To fix this, drop the locks held in the backup environment by
dropping the environment itself and rely on the cleanup to reacquire
them again.
Fixes: https://forum.proxmox.com/threads/183138/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/backup/mod.rs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
index 86ec49487..8848ca99c 100644
--- a/src/api2/backup/mod.rs
+++ b/src/api2/backup/mod.rs
@@ -288,9 +288,14 @@ fn upgrade_to_backup_protocol(
if benchmark {
env.log("benchmark finished successfully");
proxmox_async::runtime::block_in_place(|| {
- env.datastore.remove_backup_dir(
- env.backup_dir.backup_ns(),
- env.backup_dir.as_ref(),
+ let datastore = env.datastore.clone();
+ let namespace = env.backup_dir.backup_ns().clone();
+ let snapshot = env.backup_dir.dir().clone();
+ // draps all locks
+ drop(env);
+ datastore.remove_backup_dir(
+ &namespace,
+ &snapshot,
true,
)
})?;
--
2.47.3
reply other threads:[~2026-04-30 14:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260430135931.722979-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