diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-06-08 18:26:13 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-06-12 02:58:55 +0000 |
| commit | 23da02f0189cc046def58a43117b50d7918e62e1 (patch) | |
| tree | 6fc65ede1d22cac22d82b2c77eb467f20515db08 /recipes-containers/go-errors | |
| parent | a28f3d77c4abee80a38ee89d619c2fabc5279bd0 (diff) | |
| download | meta-virtualization-23da02f0189cc046def58a43117b50d7918e62e1.tar.gz | |
vrunner: poll for clean VM exit before SIGTERM in daemon_stop
The daemon_stop() flow sent ===SHUTDOWN=== over virtio-serial and then
slept exactly 2 seconds before unconditionally SIGTERMing QEMU. The
guest's graceful_shutdown(), which is what the SHUTDOWN command
ultimately triggers, does:
sync
umount /var/lib/containers/storage (ext4 journal commit)
sync
blockdev --flushbufs (per disk)
sync
sleep 2
reboot -f
Under load this routinely takes 5-30 seconds — the ext4 journal commit
on the state disk after a vimport that just wrote tens of MB of layer
blobs is the slow step. A fixed 2-second wait followed by SIGTERM kills
the guest mid-umount and leaves the state disk's journal half-committed:
layer files have correct inode metadata but partially-unwritten data
extents.
The next memres session remounts that disk and reads the apparently-OK
files. Tar-split reassembly during podman save / podman push then hits
the unwritten extents and produces:
Error: reading blob sha256:<hash>: EOF
Error: reading blob sha256:<hash>: file integrity checksum failed
for "<file>"
Reported via yocto-patches as a workaround in run-push-containers
(`<runtime> image rm --all` before push) on the autobuilder. The
"first push works, subsequent fail" pattern in that report comes from
the first push hitting a clean session and subsequent pushes inheriting
the corrupted state disk from the prior SIGTERM-truncated shutdown.
Replace the fixed sleep with a poll loop that watches for the QEMU
process to exit, up to 60 seconds (120 * 0.5s). 60s is generous enough
to cover heavy ext4 journal commits; short enough that a truly hung
guest doesn't block the caller indefinitely. The existing SIGTERM and
SIGKILL escalation paths remain as fallbacks for the genuinely-stuck
case.
Reproducer: vimport an OCI image as testimg:latest, save it, memres
restart, re-vimport, save again. Without this fix the second save
fails 100% of the time on the same blob digest with EOF or CRC error.
With this fix six consecutive vimport+save cycles across three restart
rounds complete cleanly.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/go-errors')
0 files changed, 0 insertions, 0 deletions
