$ the-wire · showcase
Undici plugs two hangs, Node 16.0 V8 migration begins
By RepoJournal · Filed · About Node.js · Composed from the cited sources · methodology
Undici fixes two distinct ways a request can hang forever, while nodejs/node lands CycloneDX SBOM generation and moves off an API V8 16.0 deletes.
fix: destroy HTTP/1 sockets on error nodejs/undici
Some TLS errors emit a socket error without closing the connection, and the HTTP/1 client relied on closure to settle in-flight requests, so a request or response stream could hang until a timeout or indefinitely when timeouts are disabled. The fix destroys HTTP/1 sockets on error, which also lets an affected idle keep-alive socket be evicted.
fix(h2): reset aborted streams with CANCEL nodejs/undici
abort() in lib/dispatcher/client-h2.js closed streams with the default NO_ERROR code and destroyed them synchronously; when the request body was still queued, the deferred RST_STREAM never went out and nghttp2 looped on empty DATA frames until the process ran out of memory. Aborted streams now reset with CANCEL instead.
node-api: find the Environment once nodejs/node
Without an async context, napi_make_callback went through node::MakeCallback(), which looked up the Environment from the creation context on every call, and node_napi_env__::node_env() re-resolved it too, including in can_call_into_js(). The Environment is now found once, since a napi_env lives as long as its Environment; the author notes there was no benchmark for the napi_make_callback path b...
tools,build: add CycloneDX SBOM generation nodejs/node
tools/sbom/generate_sbom.py is a stdlib-only Python 3 script that writes a CycloneDX 1.7 SBOM for the bundled dependencies of the binary, reading config.gypi to see which deps are active and pulling versions from C headers, CMakeLists.txt, package.json, Cargo.toml and others. An unreadable version is reported as "unknown" with a warning rather than failing the build.
src: migrate off ArrayBufferView::Buffer() nodejs/node
V8 16.0 removes ArrayBufferView::Buffer(), so node's source now uses GetBuffer(), available since V8 15.8. The commit was taken from canary-base with DCHECKs added on the API assumptions.
deps: update zstd to 1.6.0 nodejs/node
Also in nodejs/node: an automated bump of the bundled zstd to 1.6.0, and in string_decoder the deprecated babel-polyfill (babel 6) dev dependency is replaced by core-js@^3.51.0, with self, URL and URLSearchParams added to the harness global-leak whitelist.