Skip to content

fix(orcad): a slow Windows process-table read no longer fails startup readiness - #25726

Closed
OrcaWin wants to merge 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/orcad-readiness-win-process-table
Closed

OrcaWin wants to merge 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/orcad-readiness-win-process-table

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​46
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40

ELI5

On a busy Windows machine, a freshly installed orcad server could refuse to start. Its startup self-check asks Windows for the list of running processes, and gave up if Windows took more than 3 seconds to answer. Now a slow answer gets retried, and slowness alone never stops the server from starting.

What Changed

  • Before: on a loaded Windows host (CI runner, AV-scanned or busy machine), a new orcad candidate could fail its own readiness check with Error: windows process table timed out. The deploy then reported installed-not-activated / orcad_activation_no_readiness, and if nothing was active before, the host served nothing.
  • After: the readiness self-test retries a timed-out process-table read for up to 30 seconds, every 500ms. If the table still hasn't answered, orcad starts anyway and logs one warning.
  • Mechanism:
    • src/main/orcad/orcad-runtime-native-preflight.ts: preflightWindowsProcessIdentity now reads through readProcessTableWithinBudget. Only reads that timed out are retried. A read that is refused as wedged, because an earlier read hasn't called back yet, is the same slowness and is retried too.
    • src/main/windows/windows-process-table.ts: the timed-out and wedged rejections are now a typed WindowsProcessTableTimeoutError (new windows-process-table-timeout-error.ts). Readiness can tell slowness apart from a wrong answer without matching message strings. The messages are unchanged.
  • Still fatal:
    • The binding is missing or lacks creation times.
    • The table answers without our own pid, or with a bad creation time.
    • The read fails outright (unreadable, no snapshot).

Why

The self-test exists to catch a broken or mismatched native process-table binding before the server owns user state. A wrong answer proves that; a slow answer doesn't.

The 3s deadline belongs to a single read: it stops one stuck native call from wedging the reader forever. That makes it too tight to judge readiness on a loaded host. Runtime readers already treat a timeout as "unverifiable", so starting with a slow table loses nothing, while refusing to start loses the whole host.

The budget fits inside the 90s outer readiness timeout (ORCAD_PROFILE_PREFLIGHT_TIMEOUT_MS), alongside the PTY and watcher probes.

Alternatives considered:

  • Dropping the read from readiness altogether would stop catching a broken binding.
  • Raising the per-read deadline would also lengthen how long every runtime caller waits on a wedged reader.

Linked Issue

Node-runtime Phase 3. Windows sibling of real-host BUG-17. Evidence: CI artifact 11375862451 (orcad-cmd.json, candidate orcad.log).

Visual Proof

N/A: server startup only, no UI.

Testing

  • Automated tests added: orcad-runtime-native-preflight.test.ts covers four cases:

    • a timed-out read, then a wedged one, then a successful read passes;
    • a table that stays slow past the budget still starts;
    • a table without our pid still fails;
    • an outright read failure is not retried.

    The first two fail on the old code. windows-process-table.test.ts now asserts that timed-out and wedged reads reject with the typed error.

  • I manually tested these changes locally (macOS; the Windows path is unit-tested)

Notes

SSH: this is the readiness check a managed orcad runs on a Windows SSH host before activation, so the fix applies there directly. No wire or protocol change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (typecheck node, the touched tests and the changed-code gate pass locally; CI covers the rest)

… readiness

The readiness self-test read the process table once against its 3s deadline, so a loaded
host failed activation (orcad_activation_no_readiness). Timeouts now retry within a 30s
budget and, if the table never answers, start anyway with a warning. A table that answers
wrongly or fails outright still fails readiness.
@OrcaWin

OrcaWin commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as a duplicate of #25723, which fixes the same Windows readiness timeout by falling back to a single-process creation-time query. That keeps the self-test meaningful without a 30s retry window.

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