Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[rush] Improve task scheduler to handle tasks that consume 100% CPU

Open
#5,607 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
node.js, typescript

Research direction

Start by tracing Rush's existing --parallelism and rush-project.json weight handling; the issue names no implementation file or test. Compare the two proposals: percentage weights should resolve against the parallelism limit, while a common/config rule should match package.json scripts and allow rush-project.json overrides.

Written by the indexing model from the issue text.

Description

Summary

@LPegasus and I recently discussed a problem where certain Rush phase scripts are heavily multithreaded, designed to consume 100% CPU. Examples:

  • ESBuild
  • Rspack
  • Jest

When Rush attempts to run several of these tasks in parallel, it overloads the machine. For ESBuild it was causing Golang deadlocks, perhaps due to an ESBuild bug that causes thread starvation. (?)

Details

This can be avoided by specifying weight=N in rush-project.json, where N is equal to the --parallelism limit. But if CI uses a value like --parallelism=100%, then N is machine dependent.

We can break this problem into two complementary design proposals:

Proposal 1: Allow % units for weight

The rush-project.json file should allow percentage values like "weight": "100%" similar to --parallelism=100%. For example if --parallelism=100% corresponds to a maximum of 8 parallel jobs, then "weight": "75%" would indicate a weight of 6.

Proposal 2: Allow weight to be specified using pattern matching

In order to use the "weight": "100%" feature, we would need to audit every operation script for every project in our monorepo, identify which ones are invoking ESBuild, and then add a corresponding rush-project.json or rig profile to adjust the weight.

However in practice, that work could be captured by a general rule like this:

Examine the package.json shell script: Does it match the RegExp /\besbuild\b/? If yes, then use "100%" as the default weight, unless it is overridden by rush-project.json.

Such a rule could be configured centrally in a common/config file.

@dmichon-msft

Dominant language
TypeScript
Stars
6.5k
Forks
708
Avg merge
4d 13h
Merged PRs (30d)
62

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/rushstack

All issues in microsoft/rushstack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.