Repository navigation
GUI: open the window before the startup SNTP sync - #95
Merged
Merged
Conversation
The startup sync ran between the passphrase requester and win_show, and it can block for a long time: gethostbyname() has no timeout under our control (a dead resolver can hang it for tens of seconds) plus up to 5s of UDP wait. With a TCP/IP stack up but the network dead, the requester closed and then nothing appeared - the parked "unlock then no window" symptom from #71, which reads as a crash. Reproduced deliberately under Copperline with a 30s stall injected at the sync site: old ordering shows a bare desktop at t=35s (gui-smoke's window assertion fails), new ordering has the window up and painted with the stall running behind it. The window is briefly unresponsive during a slow sync (amber/red LED, "------" codes) and the status line + LED refresh the moment the sync returns. CLI-forwarding semantics are unchanged: the public port still registers after the sync, so a CLI launched meanwhile falls back to its local path exactly as before. Docs: Troubleshooting gains a "window ignores clicks briefly" entry (replacing the invisible-hang failure mode); Time and Clock Sync notes the sync now happens right after the window opens. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the parked symptom in #71 — "passphrase requester closes, then no window appears" — with a root cause, a deliberate on-target reproduction, and a fix. (Not closing #71 automatically; see below for what remains of it.)
Root cause
The startup SNTP sync sat between the passphrase requester and
win_show, and it can block far longer than the nominal 5 s UDP timeout:clock_sntp_synccallsgethostbyname(), whose timeout belongs to the TCP/IP stack's resolver, not us — against a dead/black-holed DNS server that's routinely tens of seconds. With a stack running but the network down (a typical Amiberry test-session state), the requester closed and then nothing appeared until the resolver gave up. This also explains why the symptom "hasn't been seen recently": no stack configured →bsdsocketopen fails instantly → sync skips.This displaces the parked LISTBROWSER-relist theory: the first relist paints
------placeholders (cheap); the network block was sitting directly in the reported gap.Reproduction (deliberate, on-target)
Two instrumented builds with an identical 30 s
Delay()injected at the sync call site, run throughgui-smoke's window assertion with the screenshot at t=35 s:unique_colours=1— the reported symptom, verbatim.The fix
Move the sync to right after
win_show(and refresh the status line + LED immediately on success rather than waiting for the next tick). Worst case is now a visible, briefly unresponsive window instead of an invisible hang. Placement detail: the sync stays before the public-portAddPort, so a CLI launched during a slow sync falls back to its local path exactly as before — registering the port earlier would instead make forwarded requests block on the unserviced port.A fully async sync (subprocess) would remove even the brief unresponsiveness, but that's real machinery for a window that's normally sub-second; noted as a possible future refinement.
What this does and doesn't settle in #71
killtaskdev tool committed (it was never checked in and isn't on disk); otherwise this closes the loop.Verified
make test(194),make gui-smoke(normal, non-instrumented),mkdocs build --strict+make guideclean. Docs updated in-branch: Troubleshooting gains "window ignores clicks briefly after unlocking", Time-and-Clock-Sync notes the new ordering.🤖 Generated with Claude Code