From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B799D1FF0DF for ; Thu, 19 Nov 2026 11:18:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 542DE21673; Thu, 19 Nov 2026 11:18:52 +0100 (CET) Message-ID: <0bad6679-5fd9-470f-be6e-df0230cd44e8@proxmox.com> Date: Thu, 19 Nov 2026 11:18:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox 1/4] sys: fs: report lock timeouts as such instead of EINTR To: Christian Ebner , pbs-devel@lists.proxmox.com References: <20261118180228.341628-1-c.ebner@proxmox.com> <20261118180228.341628-2-c.ebner@proxmox.com> Content-Language: en-US, de-AT From: Robert Obkircher In-Reply-To: <20261118180228.341628-2-c.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795083529233 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.479 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: P22WCOJJR552ZSO4QVGCJU5XAYZBLRDG X-Message-ID-Hash: P22WCOJJR552ZSO4QVGCJU5XAYZBLRDG 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: On 18.11.26 19:02, Christian Ebner wrote: > Improves the error handling for file locking failing because of a > timeout. Since the timeout is implemented by a timer signal that > interrupts the blocking flock call, the propagated error message > states, e.g.: > ``` > Unable to acquire lock "/var/log/proxmox-backup/tasks/.active.lock" - Interrupted system call (os error 4) > ``` > Instead, report that lock acquisition timed out after waiting for > the requested duration, which is more telling. Other errors kinds > remain unchanged. > > Signed-off-by: Christian Ebner > --- > proxmox-sys/src/fs/file.rs | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/proxmox-sys/src/fs/file.rs b/proxmox-sys/src/fs/file.rs > index 4b7cfa8a..9c5d471a 100644 > --- a/proxmox-sys/src/fs/file.rs > +++ b/proxmox-sys/src/fs/file.rs > @@ -474,6 +474,9 @@ pub fn open_file_locked>( > > match lock_file(&mut file, exclusive, Some(timeout)) { > Ok(_) => Ok(file), > + Err(err) if err.kind() == io::ErrorKind::Interrupted => { > + bail!("Unable to acquire lock {path:?} - timed out after {timeout:?}") > + } The timeout value would be misleading if another signal interrupted the call earlier than expected. > Err(err) => bail!("Unable to acquire lock {:?} - {}", path, err), > } > }