Skip to content

Conversation

@jomitchellnv
Copy link

Inside tasks.py the following line exists for creating folders.

if not os.path.exists(out_dir):
        os.makedirs(out_dir)

However, if you have a multi-node system running, this may happen.

Process 0 checks os.path.exists(out_dir) → returns False
Process 1 checks os.path.exists(out_dir) → returns False
Process 0 calls os.makedirs(out_dir) → succeeds
Process 1 calls os.makedirs(out_dir) → fails with FileExistsError

Thus, the solution here is to use os.makedirs(out_dir, exist_ok=True)

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.

1 participant