-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix apt-get lock held by another process error by retry #82
Fix apt-get lock held by another process error by retry #82
Conversation
pleskdistup/common/src/dpkg.py
Outdated
cant_get_lock = True | ||
|
||
cmd = ["apt-get", "dist-upgrade", "-y"] + APT_CHOOSE_OLD_FILES_OPTIONS | ||
while True: |
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.
Can we use for interval in locked_sleep_intervals
instead? This way, we can at least get rid of i
and check for it
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.
Yes it's my first thought as well but locked_sleep_intervals
could be empty which means no retry at all - so I needed do ... while()
in python
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.
Perhaps we could use a retry decorator instead? We just need to find a way to include sleep 🤔
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.
Perhaps we should create our own simple decorator for this, as the default one does not support any delay.
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.
Yes maybe later. Our need is a bit different though: Feed the ("command") decorator with (possibly many) regexp/strings that the program might emit and designates temporary failure.
0911232
to
ec98698
Compare
173dc6b
to
27a5864
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.
Please rebase before merge.
eb39210
to
4360058
Compare
Fixes PAUX-6388 Failed Upgrade - Could not get lock /var/cache/apt/archives/lock. It is held by process 37677 (python3)