From: Robert Obkircher <r.obkircher@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox 1/4] sys: fs: report lock timeouts as such instead of EINTR
Date: Thu, 19 Nov 2026 11:18:49 +0100 [thread overview]
Message-ID: <0bad6679-5fd9-470f-be6e-df0230cd44e8@proxmox.com> (raw)
In-Reply-To: <20261118180228.341628-2-c.ebner@proxmox.com>
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 <c.ebner@proxmox.com>
> ---
> 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<P: AsRef<Path>>(
>
> 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),
> }
> }
next prev parent reply other threads:[~2026-11-19 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 18:02 [PATCH proxmox 0/4] fix #8341: reduce task list lock contention during old task log cleanup Christian Ebner
2026-11-18 18:02 ` [PATCH proxmox 1/4] sys: fs: report lock timeouts as such instead of EINTR Christian Ebner
2026-11-19 10:18 ` Robert Obkircher [this message]
2026-11-19 10:53 ` Christian Ebner
2026-11-18 18:02 ` [PATCH proxmox 2/4] rest-server: use shared instead of exclusive lock for old task cleanup Christian Ebner
2026-11-18 18:02 ` [PATCH proxmox 3/4] fix #8341: rest-server: do not lock task list during old log cleanup Christian Ebner
2026-11-18 18:02 ` [PATCH proxmox 4/4] rest-server: clamp old task log cleanup cutoff to earliest active task Christian Ebner
2026-11-19 10:55 ` Robert Obkircher
2026-11-19 11:06 ` Christian Ebner
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=0bad6679-5fd9-470f-be6e-df0230cd44e8@proxmox.com \
--to=r.obkircher@proxmox.com \
--cc=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