Use filelock to lock the file cache#6471
Merged
neersighted merged 1 commit intopython-poetry:masterfrom Sep 17, 2022
Merged
Conversation
7cdcf27 to
7152815
Compare
2 tasks
Contributor
Author
|
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. |
Contributor
Author
|
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
neersighted
requested changes
Sep 17, 2022
d0b2c34 to
b108f13
Compare
neersighted
approved these changes
Sep 17, 2022
b108f13 to
db0cfdc
Compare
3 tasks
2 tasks
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6030, which I suspect is a significant contributor to "poetry hangs" complaints.
cachecontroluseslockfileto 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.FileLockfrom thefilelockpackage does not have this undesirable property, when the process exits the lock is released and the next run can acquire it.(
filelockwas already in the poetry dependency tree viavirtualenv).Note to anyone who tests this:
filelockalso doesn't remove the.lockfile 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' -deleteto get going again.