Zypper and Systemd: Concurrent Transaction Lock Handling
0 reputation · 05 Jun 2021, 02:43 UTC
In openSUSE Leap 15.6, the zypper package manager utilizes an exclusive advisory lock file located at /var/run/zypper.lock to serialize package operations. This mechanism ensures that only one transaction occurs at a time to prevent database corruption.
When multiple zypper sessions are initiated concurrently, subsequent processes block and retry until the lock is released. While this prevents conflicts, it introduces queuing latency. Furthermore, if a process is terminated unexpectedly via SIGKILL, the lock file persists, causing all future zypper commands to fail until the file is manually deleted.
There is currently no documented configuration to adjust the retry interval or implement an automatic timeout for these blocks. Additionally, it is unclear if there is a standardized systemd integration to detect and clear stale locks without manual administrator intervention.
- Does zypper provide a hidden or undocumented configuration to define a maximum wait time for the lock?
- Is there a recommended systemd
tmpfiles.dconfiguration to safely handle stale locks without risking race conditions during boot?