KamoCRM

The restart could land mid-initramfs and leave a computer unbootable

FixKlusterServices
已装运
2026年9月24日 01:43 UTC
作者
Kamo
提交
45d5dd3

A brand new computer provisioned, came up, reported AWAKE, and ninety seconds later panicked: Kernel panic - not syncing: No working init found. I caused that. _ensure_resume writes the grub fragment, runs update-grub, and only THEN runs update-initramfs -u. resume_restart_decision is satisfied the moment update-grub finishes — it checks grub.cfg — so a watcher tick landing in that window rebooted the machine while the initramfs was still being written. A truncated initrd cannot mount root, the kernel cannot exec init, and the computer is unbootable with nothing in it able to say why. The window was opened by moving the restart into IdleWatcher.tick(), which does not hold the lock that configure() takes. So restart_for_resume now takes that same lock before it decides anything. Non-blocking, deliberately: configure() holds the lock for minutes while it writes a RAM-sized swap file to a network volume, and the idle watcher has to keep polling through that rather than stall behind it. A skipped tick costs thirty seconds and the refusal says exactly why. The regression test holds the lock and asserts that no reboot is issued, then releases it and asserts the next attempt proceeds.

所有更改

就像你看到的运输?

所有东西都是靠自己运入你的工作空间的 从免费计划开始,一个月后再读这页.

永远开始自由查看定价