-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use filelock to lock the file cache #6471
Conversation
7cdcf27
to
7152815
Compare
Somewhat to my surprise, cachecontrol - which I had thought completely inactive - accepted my MR to switch their internal implementation from lockfile to filelock, and also released a version 0.12.12. So this becomes redundant and simply updating cachecontrol should now be enough to fix #6030. |
cachecontrol 0.12.12 was yanked on the grounds that it was breaking, a 0.13 been promised but not yet delivered. It's hard to predict when - or whether - that will happen, so reopening this. If and when cachecontrol 0.13 arrives this can be closed without merging, or reverted. |
7152815
to
d0b2c34
Compare
d0b2c34
to
b108f13
Compare
b108f13
to
db0cfdc
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #6030, which I suspect is a significant contributor to "poetry hangs" complaints.
cachecontrol
useslockfile
to create lock files. In the event that poetry exits while one of those files exists (eg because the impatient user goes Ctrl-C) the lockfile is not removed. That causes subsequent runs to block when trying to download the thing that it had been in the middle of dowloading.FileLock
from thefilelock
package does not have this undesirable property, when the process exits the lock is released and the next run can acquire it.(
filelock
was already in the poetry dependency tree viavirtualenv
).Note to anyone who tests this:
filelock
also doesn't remove the.lock
file when it is done. So if you test this branch and then revert to a version of poetry usinglockfile
, you will experience the original issue. You'll want to do something likefind ~/.cache/pypoetry -name '*.lock' -delete
to get going again.