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 race condition in doit.tools.create_folder #131

Closed
wants to merge 1 commit into from

Conversation

Hinidu
Copy link
Contributor

@Hinidu Hinidu commented Mar 22, 2016

Hi again!
While making possible to run build of my project concurrently with -n NUMBER option I discovered that create_folder has a race condition: if many tasks try to create the same folder then it is possible that between checking directory existence and actual creation of the directory in the next line another task will create that directory.
Since python 3.2 os.makedirs has nice exist_ok argument that will do the same thing but without such problems.

`create_folder` had a race condition: if many tasks try to create the same folder then it is possible that between checking directory existence and actual creation of the directory in the next line another task will create that directory.
Since [python 3.2](https://docs.python.org/3.4/library/os.html#os.makedirs) `os.makedirs` has nice `exist_ok` argument that will do the same thing but without such problems.
@coveralls
Copy link

Coverage Status

Coverage decreased (-3.0e-05%) to 99.788% when pulling 7c2bff1 on Hinidu:patch-2 into 773a4a4 on pydoit:master.

@schettino72
Copy link
Member

Dropping python 2 is great 😁

I am extremely busy these days. I will merge as soon as I get some extra time, yeah i could just click a button but I dont like github merging stuff for me...

@Hinidu
Copy link
Contributor Author

Hinidu commented Mar 26, 2016

Of course! Do it at any time 😉

@schettino72
Copy link
Member

merged: 169a1df

I amended the commit to add an entry on CHANGES. so github thinks this was not merged...

thanks 😄

@schettino72 schettino72 closed this Apr 3, 2016
@Hinidu
Copy link
Contributor Author

Hinidu commented Apr 3, 2016

Thank you!

@Hinidu Hinidu deleted the patch-2 branch April 3, 2016 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants