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

os.replace() instead of os.rename() to save checkpoint #253

Closed
wants to merge 1 commit into from

Conversation

sjfleming
Copy link
Member

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.

@sjfleming
Copy link
Member Author

Merged into #259

@sjfleming sjfleming closed this Aug 28, 2023
@sjfleming sjfleming removed the request for review from mbabadi August 28, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant