Skip to content
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 running conda activate in multiple processes #8628 #9477

Merged
merged 1 commit into from Dec 19, 2019

Conversation

rulerofthehuns
Copy link
Contributor

bugfix for #8628

The cause of the problem:
_conda_activate.bat uses %RANDOM% env var to create a unique temp file.
That isn't very random, details here: https://devblogs.microsoft.com/oldnewthing/20100617-00/?p=13673
When starting multiple processes at the same time, they will try to create and use the same temp file.

The fix:
Create a random directory instead of a file, and check if the creation failed instead of checking the existence of the directory. Only one of the started processes will succeed, the rest will retry.

@rulerofthehuns rulerofthehuns requested a review from a team as a code owner December 3, 2019 14:25
@cla-bot
Copy link

cla-bot bot commented Dec 3, 2019

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @rulerofthehuns. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@msarahan
Copy link
Contributor

msarahan commented Dec 3, 2019 via email

@msarahan msarahan merged commit 96b475c into conda:master Dec 19, 2019
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants