Skip to content

Conversation

mayrstefan
Copy link

Sometimes processes read an unfinished JSON dump. To avoid dealing with exclusive locks and filesystem support we write the dump to a temporary file and rename it afterwards. This makes the json creation atomic.

Should solve #2660

Sometimes processes read an unfinished JSON dump. To avoid dealing with
exclusive locks and filesystem support we write the dump to a temporary
file and rename it afterwards. This makes the json creation atomic.
@mayrstefan
Copy link
Author

I'm no C programmer. So i copied from fopen_safe what you are doing in "w" mode and adapted it to the json creation.

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