Skip to content

fix(orcad): a desktop that met another desktop's update fence clears its note once the host answers - #25995

Merged
OrcaWin merged 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-fence-busy-recheck
Oct 6, 2026
Merged

OrcaWin merged 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-fence-busy-recheck

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​123 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​123
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​186 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​176

ELI5

When two desktops connect to the same outdated managed SSH server, one of them updates it and the other waits. The waiting desktop kept saying "An update, rollback or recovery holds this host" for minutes after the update finished. Its server status also kept showing a "deferred update" for a version the host was already running. Now the waiting desktop checks again every 45 seconds and clears the note as soon as the host answers normally. The stale deferred update disappears once the host runs that version.

What Changed

Before (real-host testing):

  • Desktop A updated a shared managed host, and desktop B, connecting at the same time, hit A's update fence.
  • B's SSH status kept serving: unverifiable, "An update, rollback or recovery holds this host; it was not started." until B reconnected, more than 6 minutes after A finished, even though B's calls worked.
  • environment status on B kept deferredUpdate {code: orcad_activation_fence_busy, candidateVersion} for a version already active.

After:

  • Recheck after the fence (part 1).
    • A connect that met the fence marks its decision internally. This covers a wake refused because the host is fenced, and an update deferred with orcad_activation_fence_busy.
    • The connect then reruns its serving check and update check every 45 seconds, without the progress statuses a connect shows.
    • It publishes the first answer free of the fence and stops.
    • It also stops when the host disconnects, when another connect replaces the status, or after about 30 minutes, which is past the 20-minute stale install lock a crashed updater can leave.
  • Stale deferral (part 2). Status reads drop a recorded deferral once the host's active version equals its candidate or is a newer release.

Why

  • Why a timer. The fence belongs to another desktop's update, so nothing on this desktop learns when it clears. A cheap periodic recheck is the only signal, and it reuses the exact checks the connect already runs.
  • Why the fence only. A deferral for live terminals is left alone. Rechecking it would repeat update attempts that the user's own terminals are deliberately blocking.
  • Why "newer" uses only the release number. Builds with the same release and different hashes still count as different, so a deferral for another build is kept.

Linked Issue

Real-host testing: two desktops racing an update on one outdated managed host (Rerun 3 on r8-shared; also r17-shared).

Visual Proof

N/A. This is status behavior, and the tests below cover it.

Testing

  • managed-server-fence-recheck.test.ts:

    • fenced twice and then serving: no publish while fenced, one publish without the note, then it stops;
    • a fence-busy deferral keeps the recheck going;
    • a host that disconnected or was replaced stops the loop at once.
  • orcad-managed-update-deferrals.test.ts:

    • the deferral is dropped when the candidate is active or a newer release runs;
    • it is kept for an older or different build, or when the active version is unknown.
  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

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

  • The recheck flag is internal to main. No new field reaches the renderer or the wire.

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)

…its note once the host answers

The serving note "holds this host" and a fence-busy update deferral stayed until a reconnect,
minutes after the other desktop's update finished. The connect now rechecks serving and the
update every 45s while the fence holds, and publishes the first answer without it. A recorded
deferral is dropped once the host runs its candidate or a newer release.

Co-Authored-By: Claude <[email protected]>
@OrcaWin
OrcaWin merged commit f221fe8 into OrcaWin/node-rt-phase3 Oct 6, 2026
52 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