Recently Saved Module Script Lost If Hub Loses Power
-
I've got a Flic Hub LR on firmware 4.6.0. I've noticed if I reboot the hub within a couple minutes after saving a module file I've just edited that the file can be completely empty or incomplete after the reboot.
But, if I reboot 10min or more after saving, the files are intact. I haven't noticed the same issue with a module's
datastore.dbcontents which seem to stay intact even when edited shortly before the reboot.Is there some delay before a saved script file is flushed to storage?
-
With reboot, you mean abruptly unplug the power and insert it again?
Yes, this is handled by the Linux kernel, which buffers writes for some time. By buffering writes, wear on the flash is reduced, which has a limited number of write / erase cycles.
Using the data store module, data is safe however since fsync is used. A journal is also used for pending writes. We believe the data consistency of such data is important to be tolerant from power outages.