projectbuendia / buendia

Main project repository (see the Wiki for details)
Apache License 2.0
117 stars 36 forks source link

Check the hwclock on boot and disable the Buendia API if it has moved backwards since the last shutdown. #238

Closed zestyping closed 4 years ago

zestyping commented 4 years ago

Closes: #226

If the internal battery power is lost, it will reset the hardware clock. To prevent the resulting catastrophic failure (which we experienced once during a demo in Bunia), this PR checks for this condition on boot and disables the Buendia API. This doesn't automatically fix the problem, but at least we can fail safely and obviously so that a human will be prompted to investigate immediately.

schuyler commented 4 years ago

I have a couple specific questions in separate comments.

However the overall intention of this PR is clear, the architectural choices seem sound, and I can't find any obvious bugs. I think it's a solid resolution of the issue.

If you've tested this locally, I think it's reasonable to go ahead and merge.

zestyping commented 4 years ago

Thanks for the quick review!