Skip to content

startupScript() lacks error recovery path to clear system.temp.Frontier.startingUp, leaving webserver hung on error #849

Closed

Description

@jsavin

Rationale

startupScript() has no error recovery path that clears system.temp.Frontier.startingUp, creating a severe robustness issue. Any failure between lines 37 (setting startingUp=true) and 242 (clearing it) leaves an HTTP server that accepts connections but never responds — forever, with no self-heal mechanism. For long-running servers, this is unacceptable. This issue exists independently of Issue #XXX (the headless registry-window bug) — both should be fixed.

Current State

  • startupScript.ut sets system.temp.Frontier.startingUp = true at line 37 as an idempotency guard
  • No try-catch or error recovery wraps the work phase (lines 37-242)
  • Any exception or failed verb call (e.g., buildMenuBar()) aborts the script mid-flight
  • system.temp.Frontier.startingUp is never cleared (line 242 unreachable on error)
  • Consequence: webserver enters infinite loop waiting for startingUp==false; accepts connections and hangs forever
  • Idempotency guard (line 33) blocks retry: if (startingUp) { return } prevents re-entry on the next request

Compare: tools.startup (also in startupScript) properly uses try-guarding to protect its work.

Desired Outcome

Guarantee system.temp.Frontier.startingUp is cleared on all exit paths from startupScript(), whether success or failure. Long-running servers remain responsive even if startup encounters recoverable errors.

Recommendation

Wrap the main work (lines 37-242) in a try-finally block to guarantee cleanup. Alternatively, try-guard each high-risk call (e.g., buildMenuBar()) and ensure local error recovery does not leave startingUp set. Example pattern:

local (ok = true);
try {
    buildMenuBar();
} catch (exception) {
    log.add(exception);
    ok = false;
}
if (!ok) { system.temp.Frontier.startingUp = false; return false; }

Exit Criteria

  • startupScript() has a try-finally or equivalent error recovery that clears startingUp on all paths
  • No exception or failed verb call leaves system.temp.Frontier.startingUp set
  • Webserver remains responsive if startup encounters an error
  • Integration tests cover startup failures (e.g., missing menu files)

Related Context

  • Related: Issue #XXX (registry-window bug is the trigger in 3.1, but this issue is independent hardening)
  • Similar pattern: tools.startup uses try-guarding; startupScript should match
  • Scope: UserTalk robustness, startup path

Activity

  1. added
    priority/p1High priority - address soon
    type/bugDefect in existing functionality, needs fix
    workstream/runtime-coreRuntime architecture, memory, lifecycle, and global context
    on Aug 10, 2026
  2. jsavin commented on Aug 11, 2026

    @jsavin
    OwnerAuthor

    Record correction + unblock (2026-08-11): the narrow-guards-only scope was forced by a compile failure when try/else wrapped the script tail, attributed to a compiler limit. #866's reconciliation shows the failing experiments ran against corrupted stored state and/or UTF-8-mangled source; on current Virgin.root the FULL-TAIL try/else wrapper compiles clean (verified, 12,328 chars, scratch object only). #872 (full-coverage startup guards) is therefore UNBLOCKED and can implement the single wrapper rather than per-call guards.

  3. added 2 commits that reference this issue on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1High priority - address soonscope/quick-win< 4 hours, obvious solutiontype/bugDefect in existing functionality, needs fixworkstream/runtime-coreRuntime architecture, memory, lifecycle, and global context

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions