-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Crash when making virtualenv directory with parallel pipenv invocations #3257
Comments
Hey @swgillespie, We did a quick check and this issue looks very darn similar to
This could be a coincidence, but if any of these issues solves your problem then I did a good job 😄 If not, the maintainers will get to this issue shortly. Cheers, |
Fixed by #3258. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
When running multiple pipenv processes simultaneously, they may both attempt to use 'mkdir_p' at the same time, which can cause one of the pipenv processes to crash when it tries to create a directory that already exists. This is a classic TOCTOU bug that has bitten many a piece of software.
I personally hit this in my continuous integration setup where I invoke
pipenv
multiple times, potentially in parallel, and see crashes such as this:The root cause is that two
pipenv
processes are racing to create the new directory subtree rooted at/home/travis/.local/share/virtualenvs
, one of them wins, and the other crashes.Expected result
I'd except both
pipenv
processes to be successful.Actual result
The
pipenv
that loses the race to create the directory crashes.Steps to replicate
Launch multiple instances of
pipenv --python 3
on a machine that previously has not used pipenv to create any virtualenvs. If you do this enough times, you'll hit the race and crash.The text was updated successfully, but these errors were encountered: