-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry if RPM lock is temporarily unavailable #62204
Conversation
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
d18caf4
to
af7285b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @witekest ! 👍
I did some comments spotting some things I think we should improve.
I've split now the handling of Zypper and RPM locks as the latter does not store information about the locking process. I've tested it by manually acquiring exclusive lock over the RPM lock file. Works as expected and retries the installation until the lock gets released. |
Co-authored-by: Pablo Suárez Hernández <[email protected]>
Differently as Zypper RPM does not write the process ID into the lock file. Therefore RPM file lock has to be handled seperately.
@witekest it seems these changes causes some failures in "windows" as We should try to avoid this, for example by doing "try/except" on the import as it is done here: https://github.com/saltstack/salt/blob/master/salt/utils/files.py#L26-L32 |
Thanks. Good hint. Updated the code accordingly. |
Co-authored-by: Pablo Suárez Hernández <[email protected]>
SLE12 systems use /var/lib/rpm/.rpm.lock as file lock. SLE15 is backwards compatible by using symbolic link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks! 👍
The users have reportedly validated the code by testing it in their environment. Feedback was positive. |
re-run pr-ubuntu-2204-amd64-py3-m2crypto-pytest |
Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]>
Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]>
@witekest it looks like pre-commit is failing isort and black checks. Please check the Contributing documentation for information on installing and using pre-commit. Thank you! |
Congratulations on your first PR being merged! 🎉 |
Thanks! |
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]> Signed-off-by: Witek Bedyk <[email protected]> Co-authored-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]> Signed-off-by: Witek Bedyk <[email protected]> Co-authored-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
* Retry if RPM lock is temporarily unavailable Backported from saltstack/salt#62204 Signed-off-by: Witek Bedyk <[email protected]> * Sync formating fixes from upstream Signed-off-by: Witek Bedyk <[email protected]>
What does this PR do?
Wait and retry if Zypper fails acquiring RPM lock file.
What issues does this PR fix or reference?
Fixes: SUSE/spacewalk#18163
Previous Behavior
Reportedly highstate was failing in case when RPM lock file was used by some other process.
New Behavior
Wait and retry if Zypper fails acquiring RPM lock file.
Merge requirements satisfied?
Commits signed with GPG?
No