public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Robert Obkircher <r.obkircher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH v1 proxmox-backup 1/2] datastore: improve error if prune can't lock a snapshot for deletion
Date: Thu, 30 Apr 2026 11:17:43 +0200	[thread overview]
Message-ID: <20260430092022.31857-2-r.obkircher@proxmox.com> (raw)
In-Reply-To: <20260430092022.31857-1-r.obkircher@proxmox.com>

Include the locking failure in the message (without causes to avoid
duplicate paths) and switch to a more readable representaiton of the
BackupDir.

Changes the error message from:

  2026-04-29T12:16:17+02:00: failed to remove dir "host/19/2026-04-29T10:16:13Z": while destroying snapshot 'BackupDir { store: "data3", ns: BackupNamespace { inner: [], len: 0 }, dir: BackupDir { group: BackupGroup { ty: Host, id: "19" }, time: 1777457773 }, backup_time_string: "2026-04-29T10:16:13Z" }'

to

  2026-04-29T16:38:24+02:00: failed to remove dir "host/28/2026-04-29T14:38:19Z": while destroying snapshot "/srv/aaaa/host/28/2026-04-29T14:38:19Z": unable to acquire snapshot lock "/run/proxmox-backup/locks/aaaa/host-28-2026\\x2d04\\x2d29T14\\x3a38\\x3a19Z"

This error is reproducible with PBS in a single-core VM by running
"Prune All" while starting many concurrent backups.

Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
 pbs-datastore/src/backup_info.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index d3871933b..1349650ac 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -886,9 +886,9 @@ impl BackupDir {
     pub(crate) fn destroy(&self, force: bool, backend: &DatastoreBackend) -> Result<(), Error> {
         let (_guard, _manifest_guard);
         if !force {
-            _guard = self
-                .lock()
-                .with_context(|| format!("while destroying snapshot '{self:?}'"))?;
+            _guard = self.lock().map_err(|err| {
+                format_err!("while destroying snapshot {:?}: {err}", self.full_path())
+            })?;
             _manifest_guard = self.lock_manifest()?;
         }
 
-- 
2.47.3





  reply	other threads:[~2026-04-30  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  9:17 [PATCH v1 proxmox-backup 0/2] improve logging Robert Obkircher
2026-04-30  9:17 ` Robert Obkircher [this message]
2026-04-30  9:17 ` [PATCH v1 proxmox-backup 2/2] tree-wide: avoid struct-style debug representation of anyhow errors Robert Obkircher

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=20260430092022.31857-2-r.obkircher@proxmox.com \
    --to=r.obkircher@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