Skip to content

fix(appstate): pass explicit 0.9s simax timeout on info query - #18

Merged
Apdelrahman1911 merged 1 commit into
mainfrom
fix/appstate-info-timeout
Dec 6, 2026
Merged

Apdelrahman1911 merged 1 commit into
mainfrom
fix/appstate-info-timeout

Conversation

@Apdelrahman1911

Copy link
Copy Markdown

Root Cause

In tools/launcher/core/src/appstate.rs, ui_state() queried {"op": "info"} with a 1200ms host socket timeout and no "timeout" field. Because host/simax/simax.m:2413 defaults timeout to 5.0s, a hung main thread always timed out the host socket at 1.2s before simax could reply {"error": "busy: ..."}, causing app-state to misclassify main-thread hangs as "suspended" and making the busy match arm unreachable.

Fix

  • Extract info_query() ({"op": "info", "timeout": 0.9}) and classify_info_reply() in appstate.rs.
  • Add unit test info_query_distinguishes_busy_from_suspended verifying simax_timeout < 1200ms and classification of busy, active, inactive, background, and socket Err.

Verification

  • Native ci.yml (rust-launcher-tests, rust-mtlvk-tests, web, build / appimage) on this PR.

Previously ui_state() sent {"op": "info"} without a "timeout" field while
asking with a 1200ms host socket timeout. Because simax defaults "timeout" to
5.0s (simax.m:2413), any hung main thread timed out on the host socket at 1.2s
before simax could return {"error": "busy: ..."}, causing appstate.rs to
misclassify main-thread hangs as "suspended".

Pass "timeout": 0.9 (strictly below 1200ms) so simax replies "busy" in time
and app-state accurately distinguishes busy main threads from RunningBoard
suspension. Add unit test covering info_query() and classify_info_reply().
@Apdelrahman1911
Apdelrahman1911 merged commit 445de69 into main Dec 6, 2026
4 checks passed
@Apdelrahman1911
Apdelrahman1911 deleted the fix/appstate-info-timeout branch December 6, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant