i think the watchdog is probably the right place for disk space monitoring. it's proactive, runs continuously (every 5 mins), has a proper threshold, and shuts the node down cleanly before damage spreads. and when disk space gets critically low, the OS itself usually starts signaling that something is wrong too, other processes start failing, logs fill up, the system becomes obviously unhealthy and use-less. because of that, i'm not sure adding CheckDiskSpace inside WriteSettings meaningfully improves discoverability for the user
from #35373:
A full disk is a common real-world cause of this exact failure — the file
exists but contains zero bytes, producing invalid JSON. The current message
does not mention this possibility, leading users to investigate hardware
corruption and crashes when the actual cause is simply insufficient disk space.
it seems like the reporter's actual pain point was not "I didn't realise my disk was full," but rather "I got a confusing error message and started suspecting hardware corruption." the full disk became obvious later; the non-obvious part was the connection between a full disk and an empty settings.json
so i wonder if the CheckDiskSpace addition may be addressing a problem that already has multiple layers of handling i.e. the watchdog from init.cpp, the OS, and other failing processes, while the real gap here is mostly a UX issue with the error wording itself
IMO, the one-line message fix already addresses the reporter's actual confusion pretty directly, which makes me think keeping the scope narrow may be the cleaner approach