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 rundir creation #3729

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion parsl/dataflow/rundirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ def make_rundir(path: str) -> str:
x = sorted([int(os.path.basename(x)) for x in prev_rundirs])[-1]
current_rundir = os.path.join(path, '{0:03}'.format(x + 1))

os.makedirs(current_rundir)
try:
os.makedirs(current_rundir)
except FileExistsError:
logger.debug("Allocated rundir {0} exists. Making rundir again.".format(current_rundir))
return make_rundir(path)
logger.debug("Parsl run initializing in rundir: {0}".format(current_rundir))
return os.path.abspath(current_rundir)

Expand Down