angular/packages
George Kalpakas 5cee709266 fix(ngcc): do not spawn more processes than intended in parallel mode (#36280)
When running in parallel mode, ngcc spawns multiple worker processed to
process the various entry-points. The number of max allowed processes is
determined by the number of CPU cores available to the OS. There is also
currently an [upper limit of 8][1]. The number of active workers is in
turn inferred by the number of [task assignments][2].

In the past, counting the entries of `ClusterMaster#taskAssignments` was
enough, because worker processes were spawned eagerly at the beginning
and corresponding entries were created in `taskAssignments`.
Since #35719 however, worker processes are spawned lazily on an as
needed basis. Because there is some delay between
[spawning a process][3] and [inserting it][4] into `taskAssignments`,
there is a short period of time when `taskAssignment.size` does not
actually represent the number of spawned processes. This can result in
spawning more than `ClusterMaster#workerCount` processes.

An example of this can be seen in #36278, where the debug logs indicate
9 worker processes had been spawned (`All 9 workers are currently busy`)
despite the hard limit of 8.

This commit fixes this by using `cluster.workers` to compute the number
of spawned worker processes. `cluster.workers` is updated synchronously
with `cluster.fork()` and thus reflects the number of spawned workers
accurately at all times.

[1]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts#L429
[2]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L108
[3]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L110
[4]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L199

PR Close #36280
2020-03-27 14:12:28 -07:00
..
animations build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
bazel feat(bazel): transform generated shims (in Ivy) with tsickle (#35975) 2020-03-17 10:17:28 -07:00
benchpress refactor(benchpress): delete broken code (#35922) 2020-03-20 10:19:48 -07:00
common fix(common): let KeyValuePipe accept type unions with null (#36093) 2020-03-24 14:41:41 -07:00
compiler feat(compiler): add dependency info and ng-content selectors to metadata (#35695) 2020-03-24 14:21:42 -07:00
compiler-cli fix(ngcc): do not spawn more processes than intended in parallel mode (#36280) 2020-03-27 14:12:28 -07:00
core fix(core): run APP_INITIALIZERs before accessing LOCALE_ID token in Ivy TestBed (#36237) 2020-03-27 11:16:57 -07:00
docs refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
elements fix(elements): correctly handle setting inputs to undefined (#36140) 2020-03-24 10:29:33 -07:00
examples docs: changes AoT to AOT for consistency (#35112) 2020-02-04 10:43:33 -08:00
forms build: enable forms tests on IE (#35971) 2020-03-13 08:01:22 -07:00
http build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
language-service fix(compiler): record correct end of expression (#34690) 2020-03-20 10:19:02 -07:00
localize build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
platform-browser build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
platform-browser-dynamic build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
platform-server build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
platform-webworker build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
platform-webworker-dynamic build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
private/testing fix(core): adhere to bootstrap options for JIT compiled components (#35534) 2020-03-19 08:57:39 -07:00
router build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
service-worker fix(service-worker): prevent SW registration strategies from affecting app stabilization (#35870) 2020-03-27 10:47:44 -07:00
upgrade build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034) 2020-03-12 09:49:00 -07:00
zone.js build(zone.js): Update zone.js release process to use google-wombot (#36110) 2020-03-17 10:40:32 -07:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
circular-deps-test.conf.js build: allow custom module resolution for ts-circular-deps tests (#36226) 2020-03-27 11:14:49 -07:00
empty.ts
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt build: bump year (#34651) 2020-01-13 07:21:43 -08:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
system.d.ts build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json build: enable IDE type checking of $localize code (#35711) 2020-02-28 07:09:50 -08:00
types.d.ts build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT