Skip to content

fix(orcad): release this app's wake fence once its dropped launch is serving - #35808

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-wake-release-live-fence
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-wake-release-live-fence

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7

ELI5

Sometimes Orca starts the server on a remote or WSL host and the "it started" reply gets lost. The server is running, but the lock Orca took to start it stays held. The next connect sees the server running and moves on, so the lock keeps blocking updates until it times out. Now, once Orca can prove the server is running and the lock is its own with nothing else in progress, it releases the lock.

What Changed

  • Before: a wake that dropped while launching kept its activation fence, and recorded its token so a later wake could reclaim the fence. If the server had actually started, the next wakeAfterPrior found the slot LIVE and returned "serving" before the reclaim branch. The fence stayed held, and deploys reported a busy fence until it went stale by age.

  • After: forgetSettledInterruptedWake (from fix(wsl): forget an interrupted wake's token once its fence is settled #35759) now knows whether the slot is LIVE. It releases the fence through the existing releaseOrcadActivationFence only when all three of these hold:

    • the slot is proven LIVE;
    • the fence's owner file names this app's interrupted-wake token;
    • no activation journal exists.

    That release command re-checks the owner token on the host before removing anything.

    Every other case behaves as in fix(wsl): forget an interrupted wake's token once its fence is settled #35759:

    • the fence is gone, or owned by another run: the token is forgotten;
    • the owner file is absent, a journal exists, the slot is only unverifiable, or a probe gets no answer: the token and the fence stay.

Why

This is a pre-existing low raised by d1c-review-high during #35690 and #35708 review. A LIVE slot proves the dropped launch finished, so the fence protects nothing. Without a journal there is no activation it could be guarding. Requiring both, plus the token check on the host, means the release only ever removes this app's own finished wake fence.

Flag-off: this is in the shared managed wake, so it applies to SSH and WSL alike, but only after an interrupted wake whose launch did start the server. Every other path is unchanged.
User-risk: low. A release happens only on positive proof of all three conditions, through the owner-guarded command.

Linked Issue

N/A (review follow-up).

Visual Proof

N/A: no UI.

Testing

orcad-managed-wake-one-fence.test.ts:

  • A dropped launch that did start the slot is released by the next serving wake, through the guarded release, and the next one-fence connect answers "serving".
  • A fence owned by another run is never released, even with the slot serving.
  • A fence that is still this app's, but has a journal, keeps both the fence and the token.
  • The first case fails without the fix.

All test files that cover the managed wake pass (including orcad-managed-wake.test.ts, 16). pnpm tc, pnpm run typecheck:ci, the changed-code quality gate, anti-slop oxlint and oxlint all pass.

  • 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 copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No wire change. SSH benefits from the same release after an interrupted wake.

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)

…serving

A wake whose launch reply was lost but whose server did start left its
fence held; the next wake saw the slot serving and returned, so deploys
saw the fence busy until it aged out. When the slot is proven LIVE, the
fence names this app's interrupted-wake token and no journal exists,
release it through the owner-guarded release command.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 000fabc6-a611-4f02-b99b-2016f02bd4a8
Commits

Reviewing files that changed from the base of the PR and between 57ff56f and a21e18b.

Files selected for processing: 2
  • src/main/managed-server/lifecycle/orcad-managed-wake-one-fence.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-wake.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Releases this app’s interrupted-wake fence when the active slot is LIVE, the owner token matches, and no activation journal is found.

  • A later wake releases its own fence after a dropped launch is already serving.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Interrupted wake token exists] --> B{Fence owner matches?}
  B -->|Another owner or fence gone| C[Forget token]
  B -->|Owner absent or probe fails| D[Keep token and fence]
  B -->|Yes| E{Slot LIVE and no journal?}
  E -->|No or check fails| D
  E -->|Yes| F[Release with host-side owner check]
  F -->|Command succeeds| C
  F -->|Command fails| D
Loading

Reviews (1) · Last reviewed commit: "fix(orcad): release this app's wake fenc..." · Reviewed by Greptile

@nwparker
nwparker merged commit c0e0246 into main Oct 29, 2026
64 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