Skip to content

[rush-daemon] Add request scheduler foundation - #5921

Open
Mo Jazayeri (mojaza) wants to merge 2 commits into
microsoft:mainfrom
mojaza:mojazayeri-microsoft-fix-issue-5897
Open

[rush-daemon] Add request scheduler foundation#5921
Mo Jazayeri (mojaza) wants to merge 2 commits into
microsoft:mainfrom
mojaza:mojazayeri-microsoft-fix-issue-5897

Conversation

@mojaza

Copy link
Copy Markdown
Contributor

Summary

Issue #5897 requires daemon requests to queue instead of failing when another Rush command is active. This PR introduces the initial @rushstack/rush-daemon package and its request admission scheduler as an independently reviewable foundation for that workstream.

Details

The scheduler defines SHARED-BUILD, SHARED-READ, and EXCLUSIVE compatibility classes. Requests in the same shared class can run concurrently, incompatible classes serialize, and a queued exclusive request gates later admissions to preserve FIFO fairness.

Admission supports queue position notifications, clean cancellation through AbortSignal, bounded waits, and fail-fast --no-wait semantics. Leases are idempotently released so a completed request cannot corrupt scheduler state.

This is intentionally a partial implementation of #5897: transport, workspace session routing, command classification, graph integration, and shared-build selection merging depend on the WS0/WS1 prerequisites and are not included here. The package is registered but not connected to the Rush CLI, so existing behavior is unchanged.

How it was tested

  • Built @rushstack/rush-daemon with Rush/Heft, including TypeScript, ESLint, and API Extractor.
  • Ran 7 scheduler unit tests covering shared concurrency, incompatible serialization, exclusive FIFO gating, fail-fast admission, timeout, cancellation, and queue position updates.

Impacted documentation

N/A. The package is not yet exposed through the Rush CLI.

Introduce the rush-daemon package with fair shared and exclusive request admission, cancellation, timeouts, and queue position reporting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@TheLarkInn Sean Larkin (TheLarkInn) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

3 participants