Fix a race condition in simultaneous poetry installations updating the cache (#6186)
If one poetry installation is writing to the cache while a second installer is attempting to read that cache file, the second installation will fail because the in-flight cache file is invalid while it is still being written to by the first process. This PR resolves this issue by having Poetry write to a temporary file in the cache directory first, and then rename the file after it's written, which is ~atomic. Resolves: #5142 I'm not sure how to test this change, as the conditions which cause this bug to appear are a little hard to reproduce.
Showing
Please
register
or
sign in
to comment