Crash can corrupt JSON metadata file #13

Open
opened 2025-04-14 16:05:42 +00:00 by Jef Roosens · 0 comments

If an Alex instance crashes right when the JSON metadata file is being written, the file can end up being corrupted. This causes the Alex instance to instantly error out whenever it starts, as the metadata file is now invalid.

This issue can be fixed by first writing to a temporary file and then atomically renaming it to the JSON.

This does expose a larger issue where if crashes occur between when the tarballs are written and the metadata file is written, these can be out of sync.

If an Alex instance crashes right when the JSON metadata file is being written, the file can end up being corrupted. This causes the Alex instance to instantly error out whenever it starts, as the metadata file is now invalid. This issue can be fixed by first writing to a temporary file and then atomically renaming it to the JSON. This does expose a larger issue where if crashes occur between when the tarballs are written and the metadata file is written, these can be out of sync.
Jef Roosens added the
bug
label 2025-04-14 16:05:42 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Chewing_Bever/alex#13
There is no content yet.