Skip to content

fix(browser): retire placements on host lease fence - #14753

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-admission-fairnessfrom
sta-4150-browser-lease-fence-placement-retirement
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-admission-fairnessfrom
sta-4150-browser-lease-fence-placement-retirement

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​175 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​173
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​75

Summary

  • mark only an exact client host generation's placements retirement-pending when its lease is terminally fenced
  • make those retirements non-cancellable while retaining capacity until exact cleanup or reconciliation proof
  • preserve negotiated reconnect grace, server placement, other hosts, and replacement generations

This is a production-inert lifecycle layer for STA-4150, stacked on #14747.

Causal evidence

Before implementation, the new public-registry oracle was 6 failed / 1 passed: explicit release, replacement, legacy disconnect, and reconnect-grace expiry all left exact placements cancellable. The reconnect-grace preservation control already passed. The candidate passes all seven assertions and the existing placement/lifecycle suite.

Validation

  • 5 focused files / 44 tests
  • 16 affected attach, reconnect, route, command, and lease files / 166 tests
  • 5/5 cross-version terminal-wire journeys
  • Node, CLI, and web typecheck
  • Electron and CLI builds
  • changed-code quality, native audit, 87-gate manifest, max-lines, localization, formatting, and diff checks

Full lint reaches the existing upstream-main type-aware warning in config/scripts/pr-test-loc-summary.test.mjs:88; this stack has zero changed-code findings.

Compatibility and cost

No exchanged field, opcode, capability, payload, publication, placement default, SSH/WSL path, folder/worktree behavior, Electron UI, or server-hosted browser behavior changes. Terminally orphaned placements intentionally keep consuming bounded placement capacity until exact cleanup completes; this fails closed instead of reusing an authority whose guest destruction is unknown.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch 2 times, most recently from c4ee7db to f66edf2 Compare August 15, 2026 09:19
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from dc85d15 to 4d40036 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch 2 times, most recently from 6844a52 to fb6389c Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from 2b289c6 to e93ede0 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from fb6389c to 5828033 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from e93ede0 to ad2334b Compare August 16, 2026 09:09
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from 5828033 to c161753 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded by the current lease-fencing lifecycle on main (a93e31a93395953b795e9f5098a6b93c8ee331af). Under src/main/runtime/browser-host/, dispatchBrowserHostLeaseFence already checks the exact lease token and host generation, fences only those placements, and makes pending retirements non-cancellable. It preserves negotiated reconnect grace and ignores stale old-generation cleanup.

Main has since advanced beyond this PR’s retained-capacity intermediate state: the terminal fence owner completes the exact retirements and releases placement capacity because a fenced client can no longer complete them, while keeping the runtime page record for same-identity recovery. browser-host-lease-placement-retirement.test.ts covers release, replacement, grace expiry, legacy disconnect, other-host/server isolation, late cleanup and capacity reclamation. Reintroducing this older pending-only stage would strand slots that current ownership now releases.

I reviewed the complete lifecycle patch and its documentation/test intent. This does not claim the broader STA-4150 activation and live-topology proof is complete.

@OrcaWin OrcaWin closed this Oct 26, 2026
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.

2 participants