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

create_dir_all is not thread safe #38045

Closed
weiznich opened this issue Nov 28, 2016 · 2 comments
Closed

create_dir_all is not thread safe #38045

weiznich opened this issue Nov 28, 2016 · 2 comments

Comments

@weiznich
Copy link
Contributor

For concurrent requests to create the same directory using create_dir_all it is possible that the request fails with Error { repr: Os { code: 17, message: "File exists" } because a second thread already has created that directory. The problem is caused by create_dir_all function in DirBuilder.

I see three solution for this problem:

  1. Document this behaviour
  2. Make create_dir_all
  3. Make create_dir_all ignoring this error?

Platform: Ubuntu 16.04 x86_64

@durka
Copy link
Contributor

durka commented Nov 28, 2016

Duplicate of #33707.

@alexcrichton
Copy link
Member

Indeed!

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

No branches or pull requests

4 participants