public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox 0/4] fix #8341: reduce task list lock contention during old task log cleanup
@ 2026-11-18 18:02 Christian Ebner
  2026-11-18 18:02 ` [PATCH proxmox 1/4] sys: fs: report lock timeouts as such instead of EINTR Christian Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Christian Ebner @ 2026-11-18 18:02 UTC (permalink / raw)
  To: pbs-devel

When rotating the task log archive and cleaning up old task logs
(scheduled daily at midnight in Proxmox Backup Server), and exclusive
lock was previously held for the entire duration of the cleanup.

On systems with a large number of task logs or slow storage,
directory traversal during task log cleanup can easily exceed the
15 second lock acquisition timeout. Because state updates on any
worker task requires an exclusive lock on `.active.lock` to update the
active task list, tasks running concurrently around midnight failed
with:
```
Unable to acquire lock "/var/log/proxmox-backup/tasks/.active.lock" - Interrupted system call (os error 4)
```

Since determining the cutoff timestamp only requires reading the
oldest entry from the task archive and is not required at all when
removing the log files for which mtime is older than the cutoff time,
acquire a shared lock only and drop it after the cutoff time has been
calculated. While at it, improve also the error message to make it
clear that a lock acquisition failed because of the timeout.

Link to the bugtracker:
https://bugzilla.proxmox.com/show_bug.cgi?id=8341

Further cleanups are suggested in https://bugzilla.proxmox.com/show_bug.cgi?id=5960
are not part of this series.


proxmox:

Christian Ebner (4):
  sys: fs: report lock timeouts as such instead of EINTR
  rest-server: use shared instead of exclusive lock for old task cleanup
  fix #8341: rest-server: do not lock task list during old log cleanup
  rest-server: clamp old task log cleanup cutoff to earliest active task

 proxmox-rest-server/src/worker_task.rs | 67 +++++++++++++++++---------
 proxmox-sys/src/fs/file.rs             |  3 ++
 2 files changed, 46 insertions(+), 24 deletions(-)


Summary over all repositories:
  2 files changed, 46 insertions(+), 24 deletions(-)

-- 
Generated by murpp 0.11.0




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-19 11:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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