qemu: control bridge waits out a slow UI and never hands on a late reply #25

Merged
noah merged 1 commits from rb/ln-ctl-bridge into rebuild 2026-10-21 01:49:14 -06:00
Owner

The rig's control bridge waited 5 s for warden-ui's reply. On the lenovo QEMU host (garm-lxqemu, two TCG guests) a page build outran it: the bridge answered an empty reply, and the UI's late reply then landed after the next command's remove and was read as that command's answer. flare-edge#1448, job 54497: assert_hit ... unparseable hit reply: '', then nav Settings/Security -- hit 360,337: obj ... (the nav got the hit's late reply), then on the retry assert_page Settings/Security -- page is ''; integration/popups-survive-rebuild failed the same way.

Changes:

  • The loop moves from rootfs/sbin/init to warden_ctl_bridge in rootfs/etc/warden-lib.sh, so a host test reaches it; init calls it on fd 3.
  • Reply wait 30 s (WARDEN_CTL_WAIT_S), was 5 s. A timeout answers bridge: no reply from warden-ui within N s: <cmd>, and the next command first drains the late reply.
  • A reply slower than 5 s is logged on the console with its time (input for the lenovo baselines, flare-edge LN-29).
  • qmp.py: Ctl raises the no-reply line as a rig fault (never judged as "page is ''"); control socket timeout 90 s (CTL_TIMEOUT_S), so it outlasts the bridge wait.
  • New host test qemu/tests/ctl-bridge-test.sh, wired into CI; 3 new cases in test_qmp_drive.py; README table row.

Local gate:

$ bash qemu/tests/ctl-bridge-test.sh
[PASS] timeout answers no-reply; the late reply is not the next answer
[PASS] default bound: a 6 s reply arrives
[PASS] slow reply logged on stderr
[PASS] fast reply not logged
[PASS] @cat answers the file and a missing-file line
[PASS] missing FIFO answers at once
ctl-bridge tests: OK (6 checks)
$ WARDEN_TEST_SH=<busybox sh symlink> bash qemu/tests/ctl-bridge-test.sh | tail -1
ctl-bridge tests: OK (6 checks)
$ python3 qemu/tests/test_qmp_drive.py
Ran 58 tests ... OK
$ bash qemu/tests/init-power-signals-test.sh; bash qemu/tests/init-daemon-order-test.sh; bash qemu/tests/run-sh-args-test.sh
(all pass)
$ shellcheck qemu/tests/ctl-bridge-test.sh qemu/rootfs/etc/warden-lib.sh qemu/rootfs/sbin/init
(clean)

Mutants: draining off (stale flag never set) fails "timeout answers no-reply; the late reply is not the next answer"; the old 5 s bound fails "default bound: a 6 s reply arrives".

The real-VM proof is the QEMU representative job on lenovo in flare-edge PR rb/w31-sdk-pin, which pins this branch.

Refs flare-edge#1448

Generated with Claude Code

https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG

The rig's control bridge waited 5 s for warden-ui's reply. On the lenovo QEMU host (garm-lxqemu, two TCG guests) a page build outran it: the bridge answered an empty reply, and the UI's late reply then landed after the next command's remove and was read as that command's answer. flare-edge#1448, job 54497: `assert_hit ... unparseable hit reply: ''`, then `nav Settings/Security -- hit 360,337: obj ...` (the nav got the hit's late reply), then on the retry `assert_page Settings/Security -- page is ''`; integration/popups-survive-rebuild failed the same way. Changes: - The loop moves from rootfs/sbin/init to `warden_ctl_bridge` in rootfs/etc/warden-lib.sh, so a host test reaches it; init calls it on fd 3. - Reply wait 30 s (`WARDEN_CTL_WAIT_S`), was 5 s. A timeout answers `bridge: no reply from warden-ui within N s: <cmd>`, and the next command first drains the late reply. - A reply slower than 5 s is logged on the console with its time (input for the lenovo baselines, flare-edge LN-29). - qmp.py: `Ctl` raises the no-reply line as a rig fault (never judged as "page is ''"); control socket timeout 90 s (`CTL_TIMEOUT_S`), so it outlasts the bridge wait. - New host test qemu/tests/ctl-bridge-test.sh, wired into CI; 3 new cases in test_qmp_drive.py; README table row. Local gate: ``` $ bash qemu/tests/ctl-bridge-test.sh [PASS] timeout answers no-reply; the late reply is not the next answer [PASS] default bound: a 6 s reply arrives [PASS] slow reply logged on stderr [PASS] fast reply not logged [PASS] @cat answers the file and a missing-file line [PASS] missing FIFO answers at once ctl-bridge tests: OK (6 checks) $ WARDEN_TEST_SH=<busybox sh symlink> bash qemu/tests/ctl-bridge-test.sh | tail -1 ctl-bridge tests: OK (6 checks) $ python3 qemu/tests/test_qmp_drive.py Ran 58 tests ... OK $ bash qemu/tests/init-power-signals-test.sh; bash qemu/tests/init-daemon-order-test.sh; bash qemu/tests/run-sh-args-test.sh (all pass) $ shellcheck qemu/tests/ctl-bridge-test.sh qemu/rootfs/etc/warden-lib.sh qemu/rootfs/sbin/init (clean) ``` Mutants: draining off (stale flag never set) fails "timeout answers no-reply; the late reply is not the next answer"; the old 5 s bound fails "default bound: a 6 s reply arrives". The real-VM proof is the QEMU representative job on lenovo in flare-edge PR rb/w31-sdk-pin, which pins this branch. Refs flare-edge#1448 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah added 1 commit 2026-10-21 00:35:17 -06:00
qemu: control bridge waits out a slow UI and never hands on a late reply
ci / test (push) Successful in 2m34s
ci / mcdc (push) Successful in 48s
ci / bench (push) Successful in 25s
ci / qemu-tools (push) Successful in 4m5s
ci / patches-apply (push) Successful in 2m26s
ci / quality (push) Successful in 1m36s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / kernel-symbols (push) Successful in 7m19s
ci / badges (push) Skipped
ci / mcdc (pull_request) Successful in 56s
ci / bench (pull_request) Successful in 17s
ci / test (pull_request) Successful in 2m29s
ci / patches-apply (pull_request) Successful in 1m25s
ci / qemu-tools (pull_request) Successful in 4m54s
ci / quality (pull_request) Successful in 2m16s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 5m57s
b94fd156b4
The bridge waited 5 s for warden-ui's reply. On the lenovo QEMU host a
page build outran it: the bridge answered an empty reply, and the UI's
late reply then landed after the next command's remove and was read as
that command's answer (flare-edge#1448: "page is ''", a nav answered
with the previous hit).

The loop moves to warden_ctl_bridge in etc/warden-lib.sh so a host test
reaches it. The wait is 30 s (WARDEN_CTL_WAIT_S); a timeout answers
"bridge: no reply from warden-ui ...", which qmp.py raises as a rig
fault, and the next command first drains the late reply. Replies slower
than 5 s are logged on the console with their time. qmp.py's control
socket timeout is 90 s so it outlasts the bridge's wait.

Tests: qemu/tests/ctl-bridge-test.sh (new, in CI), test_qmp_drive.py.

Refs flare-edge#1448

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah merged commit 7d18896a0d into rebuild 2026-10-21 01:49:14 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blueflare/bfe-core1106-sdk#25