Skip to content

Commit

Permalink
fix race condition in rundir creation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenstetzler committed Dec 28, 2024
1 parent cbe3d30 commit 13d3ef0
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 13d3ef0

Please sign in to comment.