[rush-daemon] Add request scheduler foundation - #5921
Open
Mo Jazayeri (mojaza) wants to merge 3 commits into
Open
[rush-daemon] Add request scheduler foundation#5921Mo Jazayeri (mojaza) wants to merge 3 commits into
Mo Jazayeri (mojaza) wants to merge 3 commits into
Conversation
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>
Sean Larkin (TheLarkInn)
approved these changes
Aug 14, 2026
Sean Larkin (TheLarkInn)
left a comment
Member
There was a problem hiding this comment.
🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢 🚢
There was a problem hiding this comment.
Pull request overview
Introduces the publishable @rushstack/rush-daemon package and foundational request admission scheduler.
Changes:
- Adds scheduler compatibility classes, FIFO admission, cancellation, timeouts, and queue notifications.
- Adds scheduler unit tests and public API exports.
- Registers and configures the package within the Rush monorepo.
Show a summary per file
| File | Description |
|---|---|
rush.json |
Registers the daemon project. |
README.md |
Lists the new package. |
libraries/rush-daemon/tsconfig.json |
Configures TypeScript. |
libraries/rush-daemon/src/test/RequestScheduler.test.ts |
Tests scheduler behavior. |
libraries/rush-daemon/src/RequestScheduler.ts |
Implements request scheduling. |
libraries/rush-daemon/src/index.ts |
Exports the public API. |
libraries/rush-daemon/README.md |
Describes package status. |
libraries/rush-daemon/package.json |
Defines package metadata and builds. |
libraries/rush-daemon/LICENSE |
Adds MIT licensing. |
libraries/rush-daemon/eslint.config.js |
Configures linting. |
libraries/rush-daemon/config/rig.json |
Selects the shared rig. |
libraries/rush-daemon/config/jest.config.json |
Configures Jest. |
libraries/rush-daemon/config/api-extractor.json |
Configures API Extractor. |
libraries/rush-daemon/CHANGELOG.md |
Initializes the changelog. |
libraries/rush-daemon/CHANGELOG.json |
Initializes changelog metadata. |
libraries/rush-daemon/.npmignore |
Defines published files. |
common/reviews/api/rush-daemon.api.md |
Records the public API surface. |
common/config/subspaces/default/pnpm-lock.yaml |
Adds the package importer. |
common/changes/@rushstack/rush-daemon/mojazayeri-rush-daemon-scheduler_2026-08-13-22-30.json |
Records the minor change. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Files not reviewed (1)
- common/config/subspaces/default/pnpm-lock.yaml: Generated file
- Files reviewed: 18/19 changed files
- Comments generated: 3
- Review effort level: Balanced
Bharat Middha (bmiddha)
approved these changes
Aug 17, 2026
Keep queue position callback failures from corrupting scheduler state, reject unsupported timer delays, and cover asynchronous validation and idempotent release. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #5897 requires daemon requests to queue instead of failing when another Rush command is active. This PR introduces the initial
@rushstack/rush-daemonpackage and its request admission scheduler as an independently reviewable foundation for that workstream.Details
The scheduler defines
SHARED-BUILD,SHARED-READ, andEXCLUSIVEcompatibility 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-waitsemantics. 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
@rushstack/rush-daemonwith Rush/Heft, including TypeScript, ESLint, and API Extractor.Impacted documentation
N/A. The package is not yet exposed through the Rush CLI.