Skip to content

fix(orcad): Windows readiness identifies itself by one PID when the process-table snapshot times out - #25723

Merged
OrcaWin merged 3 commits into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-win-preflight-table
Oct 6, 2026
Merged

OrcaWin merged 3 commits into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-win-preflight-table

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​38 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32

ELI5

On a busy Windows machine, a new managed Orca server version could fail to start because one startup check, reading the list of running processes, took longer than 3 seconds. The update then rejected that version. Without a previous version to fall back to, the host served nothing. The check now has a cheaper fallback, so a slow process list no longer stops a healthy runtime from starting.

What Changed

  • Before:
    • At startup, the bundled runtime's readiness preflight (preflightWindowsProcessIdentity) takes a full process-table snapshot to confirm it can read its own process creation time.
    • The snapshot has a fixed 3 s timeout. On a loaded Windows runner it timed out, startup threw windows process table timed out, and the candidate never published readiness.
    • Activation then rejected it with orcad_activation_no_readiness. Seen in fix(ssh): a connected conversion proves the host idle with the account-wide census, not this target's lists #25697's CI (run 37380932177, job 112002884926); the job passed on rerun.
  • After:
    • If the snapshot was only slow, the preflight asks the addon for this one process's creation time instead (readWindowsProcessCreationTime(process.pid)), which needs no snapshot. "Slow" means it timed out, or it was refused because an earlier read hasn't called back yet.
    • The process table now raises a typed WindowsProcessTableTimeoutError for exactly those two cases, with unchanged messages, so the preflight never matches error text.
    • An unreadable table still fails startup, with no fallback. That covers a snapshot that comes back empty or without our own pid, as it does under an EDR hook or a restricted token, a missing snapshot, and a synchronous throw. Those hosts can't give trustworthy liveness answers later, so failing qualification there is intended.
    • The same checks apply as before: the time must be positive, finite and not in the future.
    • If that query also can't answer, the original error still fails startup.
    • The upfront check that the addon reports creation times at all is unchanged.

Why

The preflight exists to prove this runtime can identify a process by creation time, which the instance lock and the stop checks need. The addon's one-process query proves that, without the cost of the whole-table snapshot that timed out. Retrying the snapshot would not help: after a timeout the table refuses further reads until the stuck read returns.

Linked Issue

The Windows counterpart of BUG-17 (#25701), reported by relay-grace from #25697's CI. Internal.

Visual Proof

N/A. No UI changes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

orcad-runtime-native-preflight.test.ts:

  • a snapshot timeout falls back to the one-process query and passes; this test fails without the fix;
  • an unreadable table never falls back and never calls the one-process query;
  • windows-process-table.test.ts asserts that a timed-out read and a read refused behind it both raise the typed error;
  • if the one-process query also returns nothing, the original error still fails startup.

Ran locally: pnpm tc:node, the changed-code gate, oxlint, the format check, and the preflight tests.

Review

Reviewed by win-serve: the fallback now covers slowness only. EDR posture, the epoch-millisecond units of getProcessCreationTime and the effect on the serving process's reader were checked and are fine.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Windows-only code path, guarded by process.platform === 'win32'. SSH: this runs on the host that executes orcad.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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 (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…rocess-table snapshot times out

A loaded Windows runner timed the whole-table snapshot out during the bundled runtime's
readiness preflight, so the candidate failed to start and activation rejected it.
…ble, never an unreadable one

An unreadable table (EDR-hooked snapshot, restricted token) must still fail qualification.
The table now rejects slowness with a typed WindowsProcessTableTimeoutError, and only that
falls back. Review by win-serve.
@OrcaWin
OrcaWin marked this pull request as ready for review October 6, 2026 00:40
@OrcaWin
OrcaWin merged commit 1086832 into OrcaWin/node-rt-phase3 Oct 6, 2026
38 checks passed
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