cache: improve out-of-disk condition
Compare changes
Self sign-up has been disabled due to increased spam activity. If you want to get access, please send an email to a project owner (preferred) or at gitlab(at)nic(dot)cz. We apologize for the inconvenience.
When suspect SIGBUS happens, print helpful error and try to remove the cache, so that the service might work again if auto-restarted.
Theoretically we could longjmp() out of the SIGBUS handler, but that would be rather messy, so let the process die.
Fixes https://gitlab.labs.nic.cz/knot/knot-resolver/issues/197 (in a sense).
Output:
SIGBUS received; this is most likely due to filling up the filesystem where cache resides.
Cache file deleted.
kresd can not recover reliably by itself, exiting.
(and the process exits as if SIGBUS had been unhandled)