[rush] Improve task scheduler to handle tasks that consume 100% CPU
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- node.js, typescript
- Domaine
- build-system, devtools
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
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 defaultweight, unless it is overridden by rush-project.json.
Such a rule could be configured centrally in a common/config file.
@dmichon-msft
- Langage dominant
- TypeScript
- Étoiles
- 6.5k
- Forks
- 708
- Merge moyen
- 4 j 13 h
- PR mergées (30 j)
- 62
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/rushstack
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Toutes les issues de microsoft/rushstack
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
-
security
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
-
chore
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100