shuzhao-li-lab / PythonCentricPipelineForMetabolomics

Python pipeline for metabolomics data preprocessing, QC, standardization and annotation
Other
9 stars 0 forks source link

Interrupting saving of experiment.json can cause corruption #30

Closed jmmitc06 closed 1 year ago

jmmitc06 commented 1 year ago

ctrl-C or other interruption during the saving of experiment.json to disk can cause corruption leading to a broken, unrecoverable experiment. Solution: saving the experiment.json should be COW-esque, i.e., we write a new experiment.json to a temp file, then atomically replace the previous experiment.json with the new one.

jmmitc06 commented 1 year ago

Fixed as of [main 4d6a7ee]. A copy of an existing experiment.json is made before saving and if the saving fails the backup is recovered from.