I did not realize this, but os.rename() will error in Windows if the destination file already exists.
os.replace() is the correct replacement.
Notes:
This is intended to be an atomic operation to move the temporary checkpoint file to its final location. We need the final checkpoint file to be complete at all times -- otherwise, another process trying to access the checkpoint file (like Cromwell copying for instance) could encounter a half-written checkpoint file, and we would set up a race condition.
Closes #250
I did not realize this, but
os.rename()
will error in Windows if the destination file already exists.os.replace()
is the correct replacement.Notes: This is intended to be an atomic operation to move the temporary checkpoint file to its final location. We need the final checkpoint file to be complete at all times -- otherwise, another process trying to access the checkpoint file (like Cromwell copying for instance) could encounter a half-written checkpoint file, and we would set up a race condition.