From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 1BF791FF13C for ; Thu, 30 Apr 2026 11:20:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EB5E7209EB; Thu, 30 Apr 2026 11:20:52 +0200 (CEST) From: Robert Obkircher 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 Message-ID: <20260430092022.31857-2-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260430092022.31857-1-r.obkircher@proxmox.com> References: <20260430092022.31857-1-r.obkircher@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777540748988 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.064 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YWEVGE7MTU422HCZPPRK5Z33IMD2HCCY X-Message-ID-Hash: YWEVGE7MTU422HCZPPRK5Z33IMD2HCCY X-MailFrom: r.obkircher@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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