Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v20.8.0 proposal #49932

Merged
merged 151 commits into from
Sep 29, 2023
Merged

v20.8.0 proposal #49932

merged 151 commits into from
Sep 29, 2023

Conversation

ruyadorno
Copy link
Member

@ruyadorno ruyadorno commented Sep 28, 2023

2023-09-28, Version 20.8.0 (Current), @ruyadorno

Notable Changes

Stream performance improvements

Performance improvements to writable and readable streams, improving the creation and destruction by ±15% and reducing the memory overhead each stream takes in Node.js

Contributed by Benjamin Gruenbaum in #49745 and Raz Luvaton in #49834.

Performance improvements for readable webstream, improving readable stream async iterator consumption by ±140% and improving readable stream pipeTo consumption by ±60%

Contributed by Raz Luvaton in #49662 and #49690.

Rework of memory management in vm APIs with the importModuleDynamically option

This rework addressed a series of long-standing memory leaks and use-after-free issues in the following APIs that support importModuleDynamically:

  • vm.Script
  • vm.compileFunction
  • vm.SyntheticModule
  • vm.SourceTextModule

This should enable affected users to upgrade from older versions of Node.js.

Contributed by Joyee Cheung in #48510.

Other notable changes

  • [32d4d29d02] - deps: add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) #49874
  • [0e686d096b] - doc: deprecate fs.F_OK, fs.R_OK, fs.W_OK, fs.X_OK (Livia Medeiros) #49683
  • [a5dd057540] - doc: deprecate util.toUSVString (Yagiz Nizipli) #49725
  • [7b6a73172f] - doc: deprecate calling promisify on a function that returns a promise (Antoine du Hamel) #49647
  • [1beefd5f16] - esm: set all hooks as release candidate (Geoffrey Booth) #49597
  • [b0ce78a75b] - module: fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) #48510
  • [4e578f8ab1] - module: fix leak of vm.SyntheticModule (Joyee Cheung) #48510
  • [69e4218772] - module: use symbol in WeakMap to manage host defined options (Joyee Cheung) #48510
  • [14ece0aa76] - (SEMVER-MINOR) src: allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) #49279
  • [9fd67fbff0] - stream: use bitmap in writable state (Raz Luvaton) #49834
  • [0ccd4638ac] - stream: use bitmap in readable state (Benjamin Gruenbaum) #49745
  • [7c5e322346] - stream: improve webstream readable async iterator performance (Raz Luvaton) #49662
  • [80b342cc38] - (SEMVER-MINOR) test_runner: accept testOnly in run (Moshe Atlow) #49753
  • [17a05b141d] - (SEMVER-MINOR) test_runner: add junit reporter (Moshe Atlow) #49614

Commits

  • [4879e3fbbe] - benchmark: add a benchmark for read() of ReadableStreams (Debadree Chatterjee) #49622
  • [78a6c73157] - benchmark: shorten pipe-to by reducing number of chunks (Raz Luvaton) #49577
  • [4126a6e4c9] - benchmark: fix webstream pipe-to (Raz Luvaton) #49552
  • [6010a91825] - bootstrap: do not expand argv1 for snapshots (Joyee Cheung) #49506
  • [8480280c4b] - bootstrap: only use the isolate snapshot when compiling code cache (Joyee Cheung) #49288
  • [b30754aa87] - build: run embedtest using node executable (Joyee Cheung) #49506
  • [31db0b8e2b] - build: add --write-snapshot-as-array-literals to configure.py (Joyee Cheung) #49312
  • [6fcb51d3ba] - debugger: use internal/url.URL instead of url.parse (LiviaMedeiros) #49590
  • [32d4d29d02] - deps: add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) #49874
  • [ad37cadc3f] - deps: V8: backport de9a5de2274f (Joyee Cheung) #49703
  • [cdd1c66222] - deps: V8: cherry-pick b33bf2dfd261 (Joyee Cheung) #49703
  • [61d18d6473] - deps: update undici to 5.24.0 (Node.js GitHub Bot) #49559
  • [b8a4fef393] - deps: remove pthread-fixes.c from uv.gyp (Ben Noordhuis) #49744
  • [6c86c0683c] - deps: update googletest to d1467f5 (Node.js GitHub Bot) #49676
  • [1424404742] - deps: update nghttp2 to 1.56.0 (Node.js GitHub Bot) #49582
  • [15b54ff95d] - deps: update googletest to 8a6feab (Node.js GitHub Bot) #49463
  • [2ceab877c2] - deps: update corepack to 0.20.0 (Node.js GitHub Bot) #49464
  • [4814872ddc] - doc: fix DEP0176 number (LiviaMedeiros) #49858
  • [0e686d096b] - doc: deprecate fs.F_OK, fs.R_OK, fs.W_OK, fs.X_OK (Livia Medeiros) #49683
  • [5877c403a2] - doc: add mertcanaltin as a triager (mert.altin) #49826
  • [864fe56432] - doc: add git node backport way to the backporting guide (Raz Luvaton) #49760
  • [e0f93492d5] - doc: improve documentation about ICU data fallback (Joyee Cheung) #49666
  • [a5dd057540] - doc: deprecate util.toUSVString (Yagiz Nizipli) #49725
  • [774c1cfd52] - doc: add missing function call to example for util.promisify (Jungku Lee) #49719
  • [fe78a34845] - doc: update output of example in mimeParams.set() (Deokjin Kim) #49718
  • [4175ea33bd] - doc: add missed inspect with numericSeparator to example (Deokjin Kim) #49717
  • [3a88571972] - doc: fix history comments (Antoine du Hamel) #49701
  • [db4ab1ccbb] - doc: add missing history info for import.meta.resolve (Antoine du Hamel) #49700
  • [a304d1ee19] - doc: link maintaining deps to pull-request.md (Marco Ippolito) #49716
  • [35294486ad] - doc: fix print results in events (Jungku Lee) #49548
  • [9f0b0e15c9] - doc: alphabetize cli.md sections (Geoffrey Booth) #49668
  • [7b6a73172f] - doc: deprecate calling promisify on a function that returns a promise (Antoine du Hamel) #49647
  • [d316b32fff] - doc: update corepack.md to account for 0.20.0 changes (Antoine du Hamel) #49486
  • [c2eac7dc7c] - doc: remove @anonrig from performance initiative (Yagiz Nizipli) #49641
  • [3d839fbf87] - doc: mark Node.js 16 as End-of-Life (Richard Lau) #49651
  • [53fb5aead8] - doc: save user preference for JS flavor (Vidar Eldøy) #49526
  • [e3594d5658] - doc: update documentation for node:process warning (Shubham Pandey) #49517
  • [8e033c3963] - doc: rename possibly confusing variable and CSS class (Antoine du Hamel) #49536
  • [d0e0eb4bb3] - doc: update outdated history info (Antoine du Hamel) #49530
  • [b4724e2e3a] - doc: close a parenthesis (Sébastien Règne) #49525
  • [0471c5798e] - doc: cast GetInternalField() return type to v8::Value in addons.md (Joyee Cheung) #49439
  • [9f8bea3dda] - doc: fix documentation for input option in child_process (Ariel Weiss) #49481
  • [f3fea92f8a] - doc: fix missing imports in test.run code examples (Oshri Asulin) #49489
  • [e426b77b67] - doc: fix documentation for fs.createWriteStream highWaterMark option (Mert Can Altın) #49456
  • [2b119108ff] - doc: updated releasers instructions for node.js website (Claudio W) #49427
  • [b9d4a80183] - doc: edit import.meta.resolve documentation (Antoine du Hamel) #49247
  • [f67433f666] - doc,tools: switch to @node-core/utils (Michaël Zasso) #49851
  • [142e256fc5] - errors: improve classRegExp in errors.js (Uzlopak) #49643
  • [6377f1bce2] - errors: use determineSpecificType in more error messages (Antoine du Hamel) #49580
  • [05f0fcb4c4] - esm: identify parent importing a url with invalid host (Jacob Smith) #49736
  • [8a6f5fb8f3] - esm: fix return type of import.meta.resolve (Antoine du Hamel) #49698
  • [a6140f1b8c] - esm: update loaders warning (Geoffrey Booth) #49633
  • [521a9327e0] - esm: fix support for URL instances in register (Antoine du Hamel) #49655
  • [3a9ea0925a] - esm: clarify ERR_REQUIRE_ESM errors (Daniel Compton) #49521
  • [1beefd5f16] - esm: set all hooks as release candidate (Geoffrey Booth) #49597
  • [be48267888] - esm: remove return value for Module.register (Antoine du Hamel) #49529
  • [e74a075124] - esm: refactor test-esm-loader-resolve-type (Geoffrey Booth) #49493
  • [17823b3533] - esm: refactor test-esm-named-exports (Geoffrey Booth) #49493
  • [f34bd15ac1] - esm: refactor mocking test (Geoffrey Booth) #49465
  • [ec323bbd99] - fs: replace SetMethodNoSideEffect in node_file (CanadaHonk) #49857
  • [6acf800123] - fs: improve error performance for unlinkSync (CanadaHonk) #49856
  • [31702c9403] - fs: improve readFileSync with file descriptors (Yagiz Nizipli) #49691
  • [835f9fe7b9] - fs: fix file descriptor validator (Yagiz Nizipli) #49752
  • [b618fe262f] - fs: improve error performance of opendirSync (Yagiz Nizipli) #49705
  • [938471ef55] - fs: improve error performance of sync methods (Yagiz Nizipli) #49593
  • [db3fc6d087] - fs: fix readdir and opendir recursive with unknown file types (William Marlow) #49603
  • [0f020ed22d] - gyp: put cctest filenames in variables (Cheng Zhao) #49178
  • [0ce1e94d12] - lib: update encoding sets in WHATWG API (Jungku Lee) #49610
  • [efd6815a7a] - lib: fix internalBinding typings (Yagiz Nizipli) #49742
  • [1287d5b74e] - lib: allow byob reader for 'blob.stream()' (Debadree Chatterjee) #49713
  • [bbc710522d] - lib: reset the cwd cache before execution (Maël Nison) #49684
  • [f62d649e4d] - lib: use internal fileURLToPath (Deokjin Kim) #49558
  • [e515046941] - lib: use internal pathToFileURL (Livia Medeiros) #49553
  • [00608e8070] - lib: check SharedArrayBuffer availability in freeze_intrinsics.js (Milan Burda) #49482
  • [8bfbe7079c] - meta: fix linter error (Antoine du Hamel) #49755
  • [58f7a9e096] - meta: add primordials strategic initiative (Benjamin Gruenbaum) #49706
  • [5366027756] - meta: bump github/codeql-action from 2.21.2 to 2.21.5 (dependabot[bot]) #49438
  • [fe26b74082] - meta: bump rtCamp/action-slack-notify from 2.2.0 to 2.2.1 (dependabot[bot]) #49437
  • [b0ce78a75b] - module: fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) #48510
  • [4e578f8ab1] - module: fix leak of vm.SyntheticModule (Joyee Cheung) #48510
  • [69e4218772] - module: use symbol in WeakMap to manage host defined options (Joyee Cheung) #48510
  • [96874e8fbc] - node-api: enable uncaught exceptions policy by default (Chengzhong Wu) #49313
  • [b931aeadfd] - perf_hooks: reduce overhead of new performance_entries (Vinicius Lourenço) #49803
  • [ad043bac31] - process: add custom dir support for heapsnapshot-signal (Jithil P Ponnan) #47854
  • [8a7c10194c] - repl: don't accumulate excess indentation in .load (Daniel X Moore) #49461
  • [10a2adeed5] - src: improve error message when ICU data cannot be initialized (Joyee Cheung) #49666
  • [ce37688bac] - src: remove unnecessary todo (Rafael Gonzaga) #49227
  • [f611583b71] - src: use SNAPSHOT_SERDES to log snapshot ser/deserialization (Joyee Cheung) #49637
  • [a597cb8457] - src: port Pipe to uv_pipe_bind2, uv_pipe_connect2 (Geoff Goodman) #49667
  • [fb21062338] - src: set --rehash-snapshot explicitly (Joyee Cheung) #49556
  • [14ece0aa76] - (SEMVER-MINOR) src: allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) #49279
  • [4b5e23c71b] - src: set ModuleWrap internal fields only once (Joyee Cheung) #49391
  • [2d3f5c7cab] - src: fix fs_type_to_name default value (Mustafa Ateş Uzun) #49239
  • [cfbcb1059c] - src: fix comment on StreamResource (rogertyang) #49193
  • [39fb83ad16] - src: do not rely on the internal field being default to undefined (Joyee Cheung) #49413
  • [9fd67fbff0] - stream: use bitmap in writable state (Raz Luvaton) #49834
  • [0ccd4638ac] - stream: use bitmap in readable state (Benjamin Gruenbaum) #49745
  • [b29d927010] - stream: improve readable webstream pipeTo (Raz Luvaton) #49690
  • [7c5e322346] - stream: improve webstream readable async iterator performance (Raz Luvaton) #49662
  • [be211ef818] - test: deflake test-vm-contextified-script-leak (Joyee Cheung) #49710
  • [355f10dab2] - test: use checkIfCollectable in vm leak tests (Joyee Cheung) #49671
  • [17cfc531aa] - test: add checkIfCollectable to test/common/gc.js (Joyee Cheung) #49671
  • [e49a573752] - test: add os setPriority, getPriority test coverage (Wael) #38771
  • [5f02711522] - test: deflake test-runner-output (Moshe Atlow) #49878
  • [cd9754d6a7] - test: mark test-runner-output as flaky (Joyee Cheung) #49854
  • [5ad00424dd] - test: use mustSucceed instead of mustCall (SiddharthDevulapalli) #49788
  • [3db9b40081] - test: refactor test-readline-async-iterators into a benchmark (Shubham Pandey) #49237
  • [2cc5ad7859] - Revert "test: mark test-http-regr-Segfault in node::Environment::KickNextTick #2928 as flaky" (Luigi Pinca) #49708
  • [e5185b053c] - test: use fs.constants for fs.access constants (Livia Medeiros) #49685
  • [b9e5b43462] - test: deflake test-http-regr-Segfault in node::Environment::KickNextTick #2928 (Luigi Pinca) #49574
  • [1fffda504e] - test: fix argument computation in embedtest (Joyee Cheung) #49506
  • [6e56f2db52] - test: skip test-child-process-stdio-reuse-readable-stdio on Windows (Joyee Cheung) #49621
  • [ab3afb330d] - test: mark test-runner-watch-mode as flaky (Joyee Cheung) #49627
  • [185d9b50db] - test: deflake test-tls-socket-close (Luigi Pinca) #49575
  • [c70c74a9e6] - test: show more info on failure in test-cli-syntax-require.js (Joyee Cheung) #49561
  • [ed7c6d1114] - test: mark test-http-regr-Segfault in node::Environment::KickNextTick #2928 as flaky (Joyee Cheung) #49565
  • [3599eebab9] - test: use spawnSyncAndExitWithoutError in sea tests (Joyee Cheung) #49543
  • [f79b153e89] - test: use spawnSyncAndExitWithoutError in test/common/sea.js (Joyee Cheung) #49543
  • [c079c73769] - test: use setImmediate() in test-heapdump-shadowrealm.js (Joyee Cheung) #49573
  • [667a92493c] - test: skip test-child-process-pipe-dataflow.js on Windows (Joyee Cheung) #49563
  • [91af0a9a3c] - Revert "test: ignore the copied entry_point.c" (Chengzhong Wu) #49515
  • [567afc71b8] - test: avoid copying test source files (Chengzhong Wu) #49515
  • [ced25a976d] - test: increase coverage of Module.register and initialize hook (Antoine du Hamel) #49532
  • [be02fbdb8a] - test: isolate globalPreload tests (Geoffrey Booth) #49545
  • [f214428845] - test: split test-crypto-dh to avoid timeout on slow machines in the CI (Joyee Cheung) #49492
  • [3987094569] - test: make test-dotenv-node-options locale-independent (Livia Medeiros) #49470
  • [34c1741792] - test: add test for urlstrings usage in node:fs (Livia Medeiros) #49471
  • [c3c6c4f007] - test: make test-worker-prof more robust (Joyee Cheung) #49274
  • [843df1a4da] - test,crypto: update WebCryptoAPI WPT (Filip Skokan) #49714
  • [80b342cc38] - (SEMVER-MINOR) test_runner: accept testOnly in run (Moshe Atlow) #49753
  • [76865515b9] - test_runner: fix test runner watch mode when no positional arguments (Moshe Atlow) #49578
  • [17a05b141d] - (SEMVER-MINOR) test_runner: add junit reporter (Moshe Atlow) #49614
  • [5672e38457] - test_runner: add jsdocs to mock.js (Caio Borghi) #49555
  • [b4d42a8f2b] - test_runner: fix invalid timer call (Erick Wendel) #49477
  • [f755e6786b] - test_runner: add jsdocs to MockTimers (Erick Wendel) #49476
  • [e7285d4bf0] - test_runner: fix typescript coverage (Moshe Atlow) #49406
  • [07a2e29bf3] - tools: support updating @reporters/github manually (Moshe Atlow) #49871
  • [5ac6722031] - tools: skip ruff on tools/node_modules (Moshe Atlow) #49838
  • [462228bd24] - tools: fix uvwasi updater (Michael Dawson) #49682
  • [ff81bfb958] - tools: update lint-md-dependencies to rollup@3.29.2 (Node.js GitHub Bot) #49679
  • [08ffc6344c] - tools: restrict internal code from using public url module (LiviaMedeiros) #49590
  • [728ebf6c97] - tools: update eslint to 8.49.0 (Node.js GitHub Bot) #49586
  • [20d038ffb1] - tools: update lint-md-dependencies to rollup@3.29.0 unified@11.0.3 (Node.js GitHub Bot) #49584
  • [210c15bd12] - tools: allow passing absolute path of config.gypi in js2c (Cheng Zhao) #49162
  • [e341efe173] - tools: configure never-stale label correctly (Michaël Zasso) #49498
  • [a8a8a498ce] - tools: update doc dependencies (Node.js GitHub Bot) #49467
  • [ac06607f9e] - typings: fix missing property in ExportedHooks (Antoine du Hamel) #49567
  • [097b59807a] - url: improve invalid url performance (Yagiz Nizipli) #49692
  • [7c2060cfac] - util: add getCwdSafe internal util fn (João Lenon) #48434
  • [c23c60f545] - zlib: disable CRC32 SIMD optimization (Luigi Pinca) #49511

joyeecheung and others added 30 commits September 27, 2023 22:17
We do not actually need to deserialize the context and the whole
environment to compile the code cache, since code cache are not
context-dependent anyway, deserializing just the isolate snapshot is
enough.

PR-URL: #49288
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This makes it easier to locate indeterminism in the snapshot, with
the following command:

$ ./configure --write-snapshot-as-array-literals
$ make V=
$ mv out/Release/obj/gen/node_snapshot.cc ./node_snapshot.cc
$ make V=
$ diff out/Release/obj/gen/node_snapshot.cc ./node_snapshot.cc

PR-URL: #49312
Refs: nodejs/build#3043
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #49406
Fixes: #49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Use a JS workload instead of repeating FS operations and use a
timer to make it less flaky on machines with little resources.

PR-URL: #49274
Refs: #26401
Refs: nodejs/reliability#640
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #49247
Refs: #49028
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
PR-URL: #49464
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #49465
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Updated to rehype-raw@7.0.0 rehype-stringify@10.0.0 unified@11.0.2

PR-URL: #49467
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
PR-URL: #49476
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #49427
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Ruy Adorno <ruyadorno@google.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #49471
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
PR-URL: #49477
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #47854
Refs: #47842
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
PR-URL: #49456
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
PR-URL: #49482
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
The script was missing necessary imports for the `run`
function and the `path` module, causing it to fail.
This commit adds the missing imports and resolves the issue.

- Import `run` from the appropriate module.
- Import `path` to resolve file paths.

The script should now run without errors.

PR-URL: #49489
Fixes: #49488
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #49481
Fixes: #49417
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #49493
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #49493
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Bumps [rtCamp/action-slack-notify](https://github.com/rtcamp/action-slack-notify) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/rtcamp/action-slack-notify/releases)
- [Commits](rtCamp/action-slack-notify@12e36fc...b24d75f)

---
updated-dependencies:
- dependency-name: rtCamp/action-slack-notify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: #49437
Refs: rtCamp/action-slack-notify@b24d75f
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.2 to 2.21.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@0ba4244...00e563e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: #49438
Refs: github/codeql-action@00e563e
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Feature requests are issues, not PRs.

PR-URL: #49498
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
For the breaking change in
https://chromium-review.googlesource.com/c/v8/v8/+/4707972

PR-URL: #49439
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #49463
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #49470
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
It's an undocumented V8 behavior that is subject to change. Instead
just check if the internal field is set to a promise. There is also
no need to check IsEmpty() since the object is guaranteed to be
constructed by the FileHandle constructor with enough internal
fields.

PR-URL: #49413
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/4707972/comment/be9285cc_a49aad88/
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: #49193
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #49162
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: #49525
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Locally this speeds up running test-crypto-dh* from 7s to 2s. This was
previously timing out in CI (took more than 2 minutes) so should see
a bigger gap in the CI.

PR-URL: #49492
Refs: #49202
Refs: nodejs/reliability#655
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Notable changes:

deps:
  * add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) #49874
doc:
  * deprecate `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` (Livia Medeiros) #49683
  * deprecate `util.toUSVString` (Yagiz Nizipli) #49725
  * deprecate calling `promisify` on a function that returns a promise (Antoine du Hamel) #49647
esm:
  * set all hooks as release candidate (Geoffrey Booth) #49597
module:
  * fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) #48510
  * fix leak of vm.SyntheticModule (Joyee Cheung) #48510
  * use symbol in WeakMap to manage host defined options (Joyee Cheung) #48510
src:
  * (SEMVER-MINOR) allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) #49279
stream:
  * use bitmap in writable state (Raz Luvaton) #49834
  * use bitmap in readable state (Benjamin Gruenbaum) #49745
  * improve webstream readable async iterator performance (Raz Luvaton) #49662
test_runner:
  * (SEMVER-MINOR) accept `testOnly` in `run` (Moshe Atlow) #49753
  * (SEMVER-MINOR) add junit reporter (Moshe Atlow) #49614

PR-URL: #49932
@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member

joyeecheung commented Sep 29, 2023

I am a bit confused by the text of the stream performance changes...isn't ± supposed to mean positive AND negative? So that would mean the performance is wiggling between a e.g. +15% improvement and also a -15% hit? I am pretty sure that's not what it was trying to say, and it was probably trying to say that the improvement is "around" 15%...so it is supposed to use something like ~15% or (if you want to be less lazy) ≈15%?

@ruyadorno
Copy link
Member Author

ruyadorno commented Sep 29, 2023

Sorry @joyeecheung I see your message here but I'm actually already running the steps to promote the release 😬 I believe it's too late to update the changelog for this release but please do follow up with the conversation so that in the future we're sure to be using the most clear way to communicate these.

@ruyadorno ruyadorno merged commit a86c2ca into v20.x Sep 29, 2023
44 of 50 checks passed
@ruyadorno ruyadorno deleted the v20.8.0-proposal branch September 29, 2023 03:06
ruyadorno added a commit that referenced this pull request Sep 29, 2023
ruyadorno added a commit that referenced this pull request Sep 29, 2023
Notable changes:

deps:
  * add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) #49874
doc:
  * deprecate `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` (Livia Medeiros) #49683
  * deprecate `util.toUSVString` (Yagiz Nizipli) #49725
  * deprecate calling `promisify` on a function that returns a promise (Antoine du Hamel) #49647
esm:
  * set all hooks as release candidate (Geoffrey Booth) #49597
module:
  * fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) #48510
  * fix leak of vm.SyntheticModule (Joyee Cheung) #48510
  * use symbol in WeakMap to manage host defined options (Joyee Cheung) #48510
src:
  * (SEMVER-MINOR) allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) #49279
stream:
  * use bitmap in writable state (Raz Luvaton) #49834
  * use bitmap in readable state (Benjamin Gruenbaum) #49745
  * improve webstream readable async iterator performance (Raz Luvaton) #49662
test_runner:
  * (SEMVER-MINOR) accept `testOnly` in `run` (Moshe Atlow) #49753
  * (SEMVER-MINOR) add junit reporter (Moshe Atlow) #49614

PR-URL: #49932
ruyadorno added a commit to ruyadorno/nodejs.org that referenced this pull request Sep 29, 2023
ruyadorno added a commit to nodejs/nodejs.org that referenced this pull request Sep 29, 2023
@rluvaton
Copy link
Member

Can't we just update the change log manually?

@SimenB
Copy link
Member

SimenB commented Sep 29, 2023

Notable change text for the vm memory management rework

#### Rework of memory management in `vm` APIs with the `importModuleDynamically` option

This rework addressed a series of long-standing memory leaks and use-after-free issues in the following APIs that support `importModuleDynamically`:

- `vm.Script`
- `vm.compileFunction`
- `vm.SyntheticModule`
- `vm.SourceTextModule`

This should enable affected users (in particular Jest users) to upgrade from older versions of Node.js.

Contributed by Joyee Cheung in [#48510](https://github.com/nodejs/node/pull/48510).

Hiya! 👋 Maintainer of Jest here. While I'm super happy to see the use-after-free issues resolved in this release of Node, I'd just like to point out that these release notes might give people a false sense of what was accomplished.

#48510 helps people who want to use native ESM in their Jest tests (i.e. --experimental-vm-modules) avoid segfaults. However, people are still stuck on an older version of Node.js (specifically 16.10) due to #35375 (comment), which is orthogonal to ESM APIs. If I run the reproduction in the OP of that issue report, I get these results (the interesting part is using Script, not the difference with compileFunction, which was the original purpose of that bug report):

$ nvm run 16.10 index.js
Running node v16.10.0 (npm v7.24.0)
Running with Script took 19 ms
Running with compileFunction took 1799 ms
Running with compileFunction and cached data took 145 ms

$ nvm run 16.11 index.js
Running node v16.11.1 (npm v8.0.0)
Running with Script took 1790 ms
Running with compileFunction took 1798 ms
Running with compileFunction and cached data took 147 ms

$ nvm run 20 index.js
Running node v20.8.0 (npm v10.1.0)
Running with Script took 1804 ms
Running with compileFunction took 1826 ms
Running with compileFunction and cached data took 141 ms

It's essentially an 100x regression in calling new Script (albeit with a large source file), which Jest does for every singe file loaded, for every single test file. And no cache, means a lot of wasted memory.

So while I, again, greatly appreciate the changes made in Node 20.8 to alleviate the segmentation faults when using ESM APIs, I think the language in the release post will give people a false hope that they can upgrade from an old (now EOL) version of Node.

❤️

@joyeecheung
Copy link
Member

joyeecheung commented Sep 29, 2023

@SimenB Thanks for explaining that, I think we can remove the "(in particular Jest users)" part, and just keep "affected users", as from what I know there are other projects getting blocked by the memory issues too (and is actually why I started looking into the issue).

@joyeecheung
Copy link
Member

joyeecheung commented Sep 29, 2023

Actually, I remember someone told me they had to use vm.Script to avoid the memory leak in vm.compileFunction, so once that gets fixed, they can switch back to vm.compileFunction (or is it the other way around with the segfault fixed? I don't quite remember). Not sure if that applies to Jest or not, though.

@SimenB
Copy link
Member

SimenB commented Sep 29, 2023

Yeah, that might be! We used compileFunction up until we encountered the regression in #35375 - seeing as code caching is broken in both cases now (😅), we might be able to go back to compileFunction. 🙂

FWIW, I attempted to use script.createCachedData() and sticking the caches in a Map - from my checks there's no difference doing so or not. But the caches are only per vm context, so if Node itself cached between contexts before, my approach is flawed.

@Uzlopak
Copy link
Contributor

Uzlopak commented Sep 29, 2023

Is it possible to replace my nickname with my realname?

From "Uzlopak" to "Aras Abbasi"?

@benjamingr
Copy link
Member

@Uzlopak where? In the release notes?

You can edit the blog post at pages/en/blog/release/v20.8.0.md in the website repo ( https://github.com/nodejs/nodejs.org ) and you can edit the changelog here: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md

@benjamingr
Copy link
Member

(But to be clear, people in the project happily refer to you however you choose, I suspect in this case they just defaulted to your alias)

@ruyadorno
Copy link
Member Author

@Uzlopak I believe it's also possible to add a .mailmap entry to ensure you're always referred by that preferred name in the future.

alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
Notable changes:

deps:
  * add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) nodejs#49874
doc:
  * deprecate `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` (Livia Medeiros) nodejs#49683
  * deprecate `util.toUSVString` (Yagiz Nizipli) nodejs#49725
  * deprecate calling `promisify` on a function that returns a promise (Antoine du Hamel) nodejs#49647
esm:
  * set all hooks as release candidate (Geoffrey Booth) nodejs#49597
module:
  * fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) nodejs#48510
  * fix leak of vm.SyntheticModule (Joyee Cheung) nodejs#48510
  * use symbol in WeakMap to manage host defined options (Joyee Cheung) nodejs#48510
src:
  * (SEMVER-MINOR) allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) nodejs#49279
stream:
  * use bitmap in writable state (Raz Luvaton) nodejs#49834
  * use bitmap in readable state (Benjamin Gruenbaum) nodejs#49745
  * improve webstream readable async iterator performance (Raz Luvaton) nodejs#49662
test_runner:
  * (SEMVER-MINOR) accept `testOnly` in `run` (Moshe Atlow) nodejs#49753
  * (SEMVER-MINOR) add junit reporter (Moshe Atlow) nodejs#49614

PR-URL: nodejs#49932
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
Notable changes:

deps:
  * add v8::Object::SetInternalFieldForNodeCore() (Joyee Cheung) nodejs#49874
doc:
  * deprecate `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` (Livia Medeiros) nodejs#49683
  * deprecate `util.toUSVString` (Yagiz Nizipli) nodejs#49725
  * deprecate calling `promisify` on a function that returns a promise (Antoine du Hamel) nodejs#49647
esm:
  * set all hooks as release candidate (Geoffrey Booth) nodejs#49597
module:
  * fix the leak in SourceTextModule and ContextifySript (Joyee Cheung) nodejs#48510
  * fix leak of vm.SyntheticModule (Joyee Cheung) nodejs#48510
  * use symbol in WeakMap to manage host defined options (Joyee Cheung) nodejs#48510
src:
  * (SEMVER-MINOR) allow embedders to override NODE_MODULE_VERSION (Cheng Zhao) nodejs#49279
stream:
  * use bitmap in writable state (Raz Luvaton) nodejs#49834
  * use bitmap in readable state (Benjamin Gruenbaum) nodejs#49745
  * improve webstream readable async iterator performance (Raz Luvaton) nodejs#49662
test_runner:
  * (SEMVER-MINOR) accept `testOnly` in `run` (Moshe Atlow) nodejs#49753
  * (SEMVER-MINOR) add junit reporter (Moshe Atlow) nodejs#49614

PR-URL: nodejs#49932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. dependencies Pull requests that update a dependency file. doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.