GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — http2: reduce per-request overhead on the server path by mcollina · Pull Request #64265 · nodejs/node Conversation
|
| server | main | this PR | Δ |
|---|---|---|---|
core API (stream.respond + end) |
61.0k req/s | 70.7k req/s | +15.9% |
compat API (res.setHeader + end) |
43.7k req/s | 50.4k req/s | +15.3% |
benchmark/compare.js (10 runs):
http2/headers.js nheaders=0 n=1000 ** 3.98 % ±2.79%
http2/headers.js nheaders=10 n=1000 *** 7.11 % ±3.32%
http2/headers.js nheaders=100 n=1000 1.67 % ±1.73%
http2/headers.js nheaders=1000 n=1000 -0.32 % ±1.26%
http2/compat.js duration=5 benchmarker='h2load' clients=2 streams=100 requests=5000 3.02 % ±4.95%
http2/write.js duration=5 benchmarker='h2load' size=100000 length=131072 streams=100 1.66 % ±8.59%
(compat.js/write.js/simple.js stream a file from fs per request, so they are dominated by file streaming and mostly insensitive to per-request overhead; no regressions.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]>
The compat layer always responded with waitForTrailers set, so every response paid for a wantTrailers C++ -> JS callback, an empty sendTrailers() submission scheduled through setImmediate(), and an extra empty DATA frame on the wire, even though the vast majority of responses never register any trailers. When the headers are flushed as part of response.end() and no trailers have been registered, there is no further opportunity to add trailers, so waitForTrailers can be skipped altogether. Headers flushed early (writeHead, write, flushHeaders) keep the previous behavior so trailers can still be added while streaming. Trailers added after response.end() are now silently dropped, matching the HTTP/1 response.addTrailers() semantics. Also reuse a shared options object for Http2ServerRequest instances created without explicit options. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: compat API 43.1k -> 49.9k req/s (+15.7% cumulative vs main). Signed-off-by: Matteo Collina <[email protected]>
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]>
When the compat layer flushes response headers before the response is ended (writeHead(), write(), flushHeaders()), it must keep waitForTrailers so that trailers can still be added while streaming. As a result, every such response paid for a wantTrailers C++ -> JS callback, an empty sendTrailers() with its setImmediate(), and a trailers() call back into C++, even though most responses never register any trailers. Introduce STREAM_OPTION_AUTO_EMPTY_TRAILERS: when set and no trailers have been handed to the native side by the time the final DATA frame is sent, the stream is finished directly in C++ with the same empty DATA frame carrying END_STREAM that the JS path would have produced, without calling into JS at all. The compat layer enables this mode whenever it responds with waitForTrailers and no trailers registered yet; a later setTrailer() call flips the stream back to JS-managed trailers through a new disableAutoTrailers() binding, so streaming trailers keep working unchanged. The wire format is identical in all cases. h2load -c 4 -m 100, 1 KiB payload, mean of 8 alternating runs against the previous commit: compat writeHead()+end() 47.8k -> 50.2k req/s (+5.0%); multi-write streaming responses +1%. Signed-off-by: Matteo Collina <[email protected]>
Two per-request scheduling eliminations: - The end-of-stream check that lets the final DATA frame carry the END_STREAM flag was scheduled with process.nextTick() on every write. When the write is dispatched from inside end() - the common case of end(chunk) - the check can instead run synchronously once end() returns and the writable state has settled. An end() override marks the stream while the base method runs, and [kWriteGeneric] hands the check back to it instead of scheduling a tick. Writes not tied to end() keep the nextTick behavior. - Every stream destruction scheduled a setImmediate() to ask the session to clean itself up, but Http2Session[kMaybeDestroy] is a no-op unless the session is closed and has no remaining streams. Gate the setImmediate() on that condition: session.close() runs its own check, and the native side notifies again through ongracefulclosecomplete once pending data is flushed. The wire format is unchanged (verified byte-identical h2load traffic), and the END_STREAM merge is preserved. h2load -c 4 -m 100, 1 KiB payload, alternating runs vs the previous commit: consistently around +1% (within run-to-run noise on any single set, positive across 42 paired samples). Signed-off-by: Matteo Collina <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]>
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Commit Queue failed- Loading data for nodejs/node/pull/64265 ✔ Done loading data for nodejs/node/pull/64265 ----------------------------------- PR info ------------------------------------ Title http2: reduce per-request overhead on the server path (#64265) Author Matteo Collina <[email protected]> (@mcollina) Branch mcollina:http2-perf-r2 -> nodejs:main Labels http2, needs-ci Commits 6 - http2: reduce per-request allocations - http2: skip trailers round trip for compat responses - http2: avoid per-write closures in kWriteGeneric - http2: finish empty trailers natively for compat streams - http2: reduce scheduled callbacks per request - http2: avoid copying the options in respond() Committers 1 - Matteo Collina <[email protected]> PR-URL: https://github.com/nodejs/node/pull/64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Thu, 02 Jul 2026 17:54:37 GMT ✔ Approvals: 3 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/64265#pullrequestreview-4629885253 ✔ - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/64265#pullrequestreview-4630177225 ✔ - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/64265#pullrequestreview-4643910192 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-07-07T03:35:34Z: https://ci.nodejs.org/job/node-test-pull-request/74622/ - Querying data for job/node-test-pull-request/74622/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 64265 From https://github.com/nodejs/node * branch refs/pull/64265/merge -> FETCH_HEAD ✔ Fetched commits as 3ee185d9cdcd..7ce1791db58d -------------------------------------------------------------------------------- Auto-merging lib/internal/http2/core.js [main ab6b0118e0] http2: reduce per-request allocations Author: Matteo Collina <[email protected]> Date: Thu Jul 2 19:42:54 2026 +0200 3 files changed, 123 insertions(+), 61 deletions(-) Auto-merging doc/api/http2.md [main 78f46dd4f1] http2: skip trailers round trip for compat responses Author: Matteo Collina <[email protected]> Date: Thu Jul 2 19:50:55 2026 +0200 2 files changed, 24 insertions(+), 2 deletions(-) Auto-merging lib/internal/http2/core.js [main f58d770739] http2: avoid per-write closures in kWriteGeneric Author: Matteo Collina <[email protected]> Date: Thu Jul 2 20:52:08 2026 +0200 1 file changed, 71 insertions(+), 35 deletions(-) Auto-merging lib/internal/http2/core.js [main 2d08c37262] http2: finish empty trailers natively for compat streams Author: Matteo Collina <[email protected]> Date: Thu Jul 2 21:54:14 2026 +0200 6 files changed, 192 insertions(+), 27 deletions(-) create mode 100644 test/parallel/test-http2-compat-serverresponse-trailers-streaming.js Auto-merging lib/internal/http2/core.js [main fde5c19051] http2: reduce scheduled callbacks per request Author: Matteo Collina <[email protected]> Date: Fri Jul 3 10:18:24 2026 +0200 1 file changed, 37 insertions(+), 2 deletions(-) Auto-merging lib/internal/http2/core.js [main 3560f0b439] http2: avoid copying the options in respond() Author: Matteo Collina <[email protected]> Date: Fri Jul 3 10:47:40 2026 +0200 1 file changed, 20 insertions(+), 15 deletions(-) ✔ Patches applied There are 6 commits in the PR. Attempting autorebase. (node:371) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/12) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- http2: reduce per-request allocations
h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating Signed-off-by: Matteo Collina <[email protected]>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 2e8f4d7...5e47f2b |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
The compat layer always responded with waitForTrailers set, so every response paid for a wantTrailers C++ -> JS callback, an empty sendTrailers() submission scheduled through setImmediate(), and an extra empty DATA frame on the wire, even though the vast majority of responses never register any trailers. When the headers are flushed as part of response.end() and no trailers have been registered, there is no further opportunity to add trailers, so waitForTrailers can be skipped altogether. Headers flushed early (writeHead, write, flushHeaders) keep the previous behavior so trailers can still be added while streaming. Trailers added after response.end() are now silently dropped, matching the HTTP/1 response.addTrailers() semantics. Also reuse a shared options object for Http2ServerRequest instances created without explicit options. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: compat API 43.1k -> 49.9k req/s (+15.7% cumulative vs main). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
When the compat layer flushes response headers before the response is ended (writeHead(), write(), flushHeaders()), it must keep waitForTrailers so that trailers can still be added while streaming. As a result, every such response paid for a wantTrailers C++ -> JS callback, an empty sendTrailers() with its setImmediate(), and a trailers() call back into C++, even though most responses never register any trailers. Introduce STREAM_OPTION_AUTO_EMPTY_TRAILERS: when set and no trailers have been handed to the native side by the time the final DATA frame is sent, the stream is finished directly in C++ with the same empty DATA frame carrying END_STREAM that the JS path would have produced, without calling into JS at all. The compat layer enables this mode whenever it responds with waitForTrailers and no trailers registered yet; a later setTrailer() call flips the stream back to JS-managed trailers through a new disableAutoTrailers() binding, so streaming trailers keep working unchanged. The wire format is identical in all cases. h2load -c 4 -m 100, 1 KiB payload, mean of 8 alternating runs against the previous commit: compat writeHead()+end() 47.8k -> 50.2k req/s (+5.0%); multi-write streaming responses +1%. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Two per-request scheduling eliminations: - The end-of-stream check that lets the final DATA frame carry the END_STREAM flag was scheduled with process.nextTick() on every write. When the write is dispatched from inside end() - the common case of end(chunk) - the check can instead run synchronously once end() returns and the writable state has settled. An end() override marks the stream while the base method runs, and [kWriteGeneric] hands the check back to it instead of scheduling a tick. Writes not tied to end() keep the nextTick behavior. - Every stream destruction scheduled a setImmediate() to ask the session to clean itself up, but Http2Session[kMaybeDestroy] is a no-op unless the session is closed and has no remaining streams. Gate the setImmediate() on that condition: session.close() runs its own check, and the native side notifies again through ongracefulclosecomplete once pending data is flushed. The wire format is unchanged (verified byte-identical h2load traffic), and the END_STREAM merge is preserved. h2load -c 4 -m 100, 1 KiB payload, alternating runs vs the previous commit: consistently around +1% (within run-to-run noise on any single set, positive across 42 paired samples). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Tim Perry <[email protected]>
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
Cut several sources of per-stream/per-request overhead on the hot path: - Track 'priority'/'frameError' stream listeners by overriding the EventEmitter methods on Http2Stream instead of subscribing to 'newListener'/'removeListener', which made every listener add and remove on every stream emit an extra tracking event. - Replace the per-call SafeSet and sensitive-header mapping in buildNgHeaderString with a lazily allocated array and an empty-array fast path, and skip the HTTP token regex and connection-specific header checks for well-known single-value header names. - Replace per-call closures with shared named handlers in onStreamClose, afterShutdown and Http2Stream._destroy. - Skip the pendingStreams Set add/delete for streams that are created with their native handle already available (all server streams). - Hoist the per-request onStreamTimeout closure factories in the compat layer to module-level handlers, and avoid a once() wrapper allocation per server stream. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs: core API 60.2k -> 69.3k req/s (+15%), compat API 43.6k -> 46.2k req/s (+5.9%). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
Every _write()/_writev() on an Http2Stream allocated four closures and an anonymous nextTick callback to coordinate the write callback with the end-of-stream check. Since the stream machinery dispatches at most one write at a time, that coordination state can live on the stream's kState object instead, with shared named functions for the end check and completion logic. When trailers are pending the writable side cannot be shut down early anyway, so the end-of-stream check tick is now skipped entirely for those writes. Also pre-initialize the kState fields that used to be added dynamically (shutdownWritableCalled, fd) so hot-path stores no longer transition the object shape. h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating runs vs main: core API 61.0k -> 70.7k req/s (+15.9% cumulative), compat API 43.7k -> 50.4k req/s (+15.3% cumulative). Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
respond() copied the user-provided options object on every call just so it could normalize and locally flip options.endStream, and prepareResponseHeadersObject() then looked the :status and date fields up again on the dictionary-mode null-prototype headers copy it had just built. Use a local variable for endStream and pick up :status/date while copying the headers instead. No measurable throughput change on its own; this removes an object clone and several dictionary-mode property lookups per response. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #64265 Backport-PR-URL: #64663 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | tools | minor | `26.5.0` → `26.7.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>nodejs/node (node)</summary> ### [`v26.7.0`](https://github.com/nodejs/node/releases/tag/v26.7.0): 2026-08-05, Version 26.7.0 (Current), @​aduh95 [Compare Source](nodejs/node@v26.5.0...v26.7.0) ##### Notable Changes - \[[`58717685a1`](nodejs/node@58717685a1)] - **(SEMVER-MINOR)** **crypto**: support loading private keys through STORE loaders (Filip Skokan) [#​63949](nodejs/node#63949) - \[[`44b940ee8c`](nodejs/node@44b940ee8c)] - **crypto**: update root certificates to NSS 3.125 (Node.js GitHub Bot) [#​64746](nodejs/node#64746) - \[[`c1e4f7365e`](nodejs/node@c1e4f7365e)] - **(SEMVER-MINOR)** **lib**: add perfetto support (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`11c2f9c642`](nodejs/node@11c2f9c642)] - **(SEMVER-MINOR)** **module**: implement `Symbol.dispose` in `ModuleHooks` (Remco Haszing) [#​63928](nodejs/node#63928) - \[[`a646319f61`](nodejs/node@a646319f61)] - **(SEMVER-MINOR)** **test\_runner**: add support for `--test-coverage-include-all` (avivkeller) [#​64830](nodejs/node#64830) ##### Commits - \[[`a2d3f891d3`](nodejs/node@a2d3f891d3)] - **async\_hooks**: use validateBoolean for trackPromises (Soul Lee) [#​64731](nodejs/node#64731) - \[[`d7266cdd99`](nodejs/node@d7266cdd99)] - **benchmark**: fix calibrate-n option handling (Luan Muniz) [#​64146](nodejs/node#64146) - \[[`2e64293e3f`](nodejs/node@2e64293e3f)] - **buffer**: use Clamp conversion in Blob slice (Donghoon Kang) [#​64739](nodejs/node#64739) - \[[`5fda0958bd`](nodejs/node@5fda0958bd)] - **buffer**: validate copyArrayBuffer offsets against buffer length (Ilia Alshanetsky) [#​63904](nodejs/node#63904) - \[[`5298db40f9`](nodejs/node@5298db40f9)] - **build**: run perfetto build and test on GHA (Chengzhong Wu) [#​64721](nodejs/node#64721) - \[[`e3eac7cef9`](nodejs/node@e3eac7cef9)] - **build**: fix v8\_use\_perfetto source scraping (Chengzhong Wu) [#​64721](nodejs/node#64721) - \[[`ab5f076d7f`](nodejs/node@ab5f076d7f)] - **build**: bump rustc requirement to >=1.86 (Renegade334) [#​64543](nodejs/node#64543) - \[[`df608e061f`](nodejs/node@df608e061f)] - **(SEMVER-MINOR)** **build**: perfetto-sdk (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`74928adc46`](nodejs/node@74928adc46)] - **build,tools**: fix shared library cross-compile (Kirill Saied) [#​63963](nodejs/node#63963) - \[[`58717685a1`](nodejs/node@58717685a1)] - **(SEMVER-MINOR)** **crypto**: support loading private keys through STORE loaders (Filip Skokan) [#​63949](nodejs/node#63949) - \[[`58d13b6f3d`](nodejs/node@58d13b6f3d)] - **crypto**: preserve OpenSSL errors from KDF failures (Filip Skokan) [#​64776](nodejs/node#64776) - \[[`478a719cb5`](nodejs/node@478a719cb5)] - **crypto**: fix Argon2 bypassing FIPS mode (Filip Skokan) [#​64776](nodejs/node#64776) - \[[`44b940ee8c`](nodejs/node@44b940ee8c)] - **crypto**: update root certificates to NSS 3.125 (Node.js GitHub Bot) [#​64746](nodejs/node#64746) - \[[`fde85237c7`](nodejs/node@fde85237c7)] - **crypto**: clarify missing cipher error (Filip Skokan) [#​64852](nodejs/node#64852) - \[[`c604d8846d`](nodejs/node@c604d8846d)] - **crypto**: reuse X509 issuer result (Filip Skokan) [#​64852](nodejs/node#64852) - \[[`c68c7d0112`](nodejs/node@c68c7d0112)] - **crypto**: validate key generation options (Filip Skokan) [#​64852](nodejs/node#64852) - \[[`c36bb1d017`](nodejs/node@c36bb1d017)] - **crypto**: fix Argon2 validation errors (Filip Skokan) [#​64852](nodejs/node#64852) - \[[`f61408bb27`](nodejs/node@f61408bb27)] - **crypto**: handle XOF output allocation failure (Filip Skokan) [#​64851](nodejs/node#64851) - \[[`2b4053d046`](nodejs/node@2b4053d046)] - **crypto**: initialize KeyObjectData mutex eagerly (Filip Skokan) [#​64851](nodejs/node#64851) - \[[`4b7b2adf44`](nodejs/node@4b7b2adf44)] - **crypto**: handle DH operation failures (Filip Skokan) [#​64851](nodejs/node#64851) - \[[`12170c3753`](nodejs/node@12170c3753)] - **crypto**: use user-facing error for output encoding changes (Archkon) [#​64692](nodejs/node#64692) - \[[`474f06d550`](nodejs/node@474f06d550)] - **debugger**: preserve overlapping CDP request state (Trivikram Kamat) [#​64467](nodejs/node#64467) - \[[`718cbe9497`](nodejs/node@718cbe9497)] - **deps**: upgrade npm to 11.19.0 (npm team) [#​64883](nodejs/node#64883) - \[[`657c6154b3`](nodejs/node@657c6154b3)] - **deps**: update ngtcp2 to 1.25.0 (Node.js GitHub Bot) [#​64944](nodejs/node#64944) - \[[`75a1fbeff9`](nodejs/node@75a1fbeff9)] - **deps**: update nghttp3 to 1.18.0 (Node.js GitHub Bot) [#​64943](nodejs/node#64943) - \[[`07d7cb7cd8`](nodejs/node@07d7cb7cd8)] - **deps**: update minimatch to 10.2.6 (Node.js GitHub Bot) [#​64945](nodejs/node#64945) - \[[`f7d56359f1`](nodejs/node@f7d56359f1)] - **deps**: update simdjson to 4.6.6 (Node.js GitHub Bot) [#​64942](nodejs/node#64942) - \[[`8b06457cfb`](nodejs/node@8b06457cfb)] - **deps**: update acorn to 8.18.0 (Node.js GitHub Bot) [#​64941](nodejs/node#64941) - \[[`5919d01525`](nodejs/node@5919d01525)] - **deps**: update googletest to [`1b6f64d`](nodejs/node@1b6f64d) (Node.js GitHub Bot) [#​64940](nodejs/node#64940) - \[[`4a87ad6cff`](nodejs/node@4a87ad6cff)] - **deps**: update nghttp2 to 1.70.0 (Node.js GitHub Bot) [#​64939](nodejs/node#64939) - \[[`c96d76a7c8`](nodejs/node@c96d76a7c8)] - **deps**: update zlib to 1.3.2.1-motley-42c2f19 (Node.js GitHub Bot) [#​64744](nodejs/node#64744) - \[[`2b59984c0f`](nodejs/node@2b59984c0f)] - **deps**: V8: backport [`5177b10`](nodejs/node@5177b10891e6) (avivkeller) [#​64631](nodejs/node#64631) - \[[`b839af91da`](nodejs/node@b839af91da)] - **deps**: update ada to 4.0.0 (Node.js GitHub Bot) [#​64790](nodejs/node#64790) - \[[`70dedef942`](nodejs/node@70dedef942)] - **deps**: update sqlite to 3.53.4 (Node.js GitHub Bot) [#​64745](nodejs/node#64745) - \[[`7bc4c171f5`](nodejs/node@7bc4c171f5)] - **deps**: update Rust crates for V8 14.6.202.34-node.26 (Renegade334) [#​64543](nodejs/node#64543) - \[[`308c6b2ac3`](nodejs/node@308c6b2ac3)] - **deps**: V8: backport [`7d9b7e0`](nodejs/node@7d9b7e03141d) (Manish Goregaokar) [#​64543](nodejs/node#64543) - \[[`8eeae28e88`](nodejs/node@8eeae28e88)] - **deps**: V8: backport [`c4d06ba`](nodejs/node@c4d06ba586f3) (liujiahui) [#​63731](nodejs/node#63731) - \[[`bbd6fc58c4`](nodejs/node@bbd6fc58c4)] - **diagnostics\_channel**: grow native channel storage (Stephen Belanger) [#​64497](nodejs/node#64497) - \[[`ce8b292955`](nodejs/node@ce8b292955)] - **doc**: fix grammar and punctuation in dgram documentation (Kamal Rawal) [#​64957](nodejs/node#64957) - \[[`1a413a60cf`](nodejs/node@1a413a60cf)] - **doc**: fix grammar and editorial issues in addons documentation (Kamal Rawal) [#​64952](nodejs/node#64952) - \[[`63fbd59e64`](nodejs/node@63fbd59e64)] - **doc**: formalize fn/name as part of TestOptions API (Christopher Hiller) [#​64946](nodejs/node#64946) - \[[`b263b0bca1`](nodejs/node@b263b0bca1)] - **doc**: remove references to `ca`/`crl` as per-context QuicSession options (René) [#​64769](nodejs/node#64769) - \[[`f37de14b27`](nodejs/node@f37de14b27)] - **doc**: fix typo in maintaining-dependencies.md (greenhead) [#​64896](nodejs/node#64896) - \[[`16cb77cdc8`](nodejs/node@16cb77cdc8)] - **doc**: add RafaelGSS as last security release stewards (Rafael Gonzaga) [#​64843](nodejs/node#64843) - \[[`335c28cd17`](nodejs/node@335c28cd17)] - **doc**: fix typos in documentation (greenhead) [#​64900](nodejs/node#64900) - \[[`d4bed8ca39`](nodejs/node@d4bed8ca39)] - **doc**: fix missing references in doc type map (Tim Perry) [#​64872](nodejs/node#64872) - \[[`e71d09d5f1`](nodejs/node@e71d09d5f1)] - **doc**: improve TestContext hook descriptions (Kamal Rawal) [#​64899](nodejs/node#64899) - \[[`7089bd9ae4`](nodejs/node@7089bd9ae4)] - **doc**: add missing float32/float64 FFI type names (Soul Lee) [#​64874](nodejs/node#64874) - \[[`8d3ae0830e`](nodejs/node@8d3ae0830e)] - **doc**: document stream.isDestroyed() (YspritanHyzygy) [#​64789](nodejs/node#64789) - \[[`a757e62af7`](nodejs/node@a757e62af7)] - **doc**: add contributing detail for git Signed-off-by trailer (Mike McCready) [#​64862](nodejs/node#64862) - \[[`3e840f43ed`](nodejs/node@3e840f43ed)] - **doc**: mark config-file as release candidate (Marco Ippolito) [#​64516](nodejs/node#64516) - \[[`70cd5df810`](nodejs/node@70cd5df810)] - **doc**: fix duplicated word in test snapshot docs (Kamal Rawal) [#​64837](nodejs/node#64837) - \[[`d5f36c7adc`](nodejs/node@d5f36c7adc)] - **doc**: remove obsolete cctest node.gyp instructions (Soul Lee) [#​64814](nodejs/node#64814) - \[[`a0bf29ea09`](nodejs/node@a0bf29ea09)] - **doc**: report proper return type on url.format (Brian Muenzenmeyer) [#​64806](nodejs/node#64806) - \[[`e655e42085`](nodejs/node@e655e42085)] - **doc**: use ffi.suffix for library paths in examples (Junsoo Ha) [#​64805](nodejs/node#64805) - \[[`e0f0830dbc`](nodejs/node@e0f0830dbc)] - **doc**: document --permission-audit audit mode behavior (Adrián Estrada) [#​64791](nodejs/node#64791) - \[[`efbede6de0`](nodejs/node@efbede6de0)] - **doc**: clarify tlsSocket.authorized on resumption (soreavis) [#​64584](nodejs/node#64584) - \[[`db95655c4a`](nodejs/node@db95655c4a)] - **doc**: stabilize --disable-warning (Jean Michelet) [#​64742](nodejs/node#64742) - \[[`a8367200be`](nodejs/node@a8367200be)] - **doc**: add MDN links for explicit resource management in fs (lluisemper) [#​59557](nodejs/node#59557) - \[[`1c09165c2e`](nodejs/node@1c09165c2e)] - **doc**: mention constructor check in deepStrictEqual (Sumit Kumar Das) [#​62010](nodejs/node#62010) - \[[`29709324e0`](nodejs/node@29709324e0)] - **doc**: update technical priorities (Jacob Smith) [#​64505](nodejs/node#64505) - \[[`522a28e648`](nodejs/node@522a28e648)] - **doc**: deprecation add more codemod (Augustin Mauroy) [#​63175](nodejs/node#63175) - \[[`c40aaa6539`](nodejs/node@c40aaa6539)] - **doc**: run license-builder (Node.js GitHub Bot) [#​63918](nodejs/node#63918) - \[[`428e9bc50f`](nodejs/node@428e9bc50f)] - **ffi**: fix crash in refCallback and unrefCallback (Trivikram Kamat) [#​64881](nodejs/node#64881) - \[[`33912103e7`](nodejs/node@33912103e7)] - **ffi**: reject fast calls after library close (Trivikram Kamat) [#​64860](nodejs/node#64860) - \[[`b348ed7f92`](nodejs/node@b348ed7f92)] - **ffi**: validate fast 32-bit integer argument ranges (Trivikram Kamat) [#​64691](nodejs/node#64691) - \[[`48f4cfb480`](nodejs/node@48f4cfb480)] - **ffi**: fix optimized buffer conversions (Trivikram Kamat) [#​64639](nodejs/node#64639) - \[[`109ffcd4f3`](nodejs/node@109ffcd4f3)] - **ffi**: preserve link register in ppc64 trampoline (Trivikram Kamat) [#​64792](nodejs/node#64792) - \[[`aa3f168b31`](nodejs/node@aa3f168b31)] - **ffi**: preserve strings during reentrant calls (Trivikram Kamat) [#​64551](nodejs/node#64551) - \[[`ca60942f38`](nodejs/node@ca60942f38)] - **ffi**: preserve uint8 semantics for bool fast calls (Trivikram Kamat) [#​64527](nodejs/node#64527) - \[[`0fb1d2bd65`](nodejs/node@0fb1d2bd65)] - **ffi**: validate fast integer argument ranges (Trivikram Kamat) [#​64614](nodejs/node#64614) - \[[`b250b40b30`](nodejs/node@b250b40b30)] - **fs**: key glob matcher cache by platform (Archkon) [#​64571](nodejs/node#64571) - \[[`e26891ec6a`](nodejs/node@e26891ec6a)] - **http**: fix writableFinished and 'finish' after write errors (Tim Perry) [#​64847](nodejs/node#64847) - \[[`dfc192fdfb`](nodejs/node@dfc192fdfb)] - **http**: avoid aborting IncomingMessage signal on normal close (Archkon) [#​64392](nodejs/node#64392) - \[[`6794441c85`](nodejs/node@6794441c85)] - **http**: guard invalid timeout values in checkConnections (Efe Karasakal) [#​64506](nodejs/node#64506) - \[[`6879aa4aa8`](nodejs/node@6879aa4aa8)] - **http**: propagate highWaterMark to ClientRequest OutgoingMessage (trivenay) [#​64653](nodejs/node#64653) - \[[`72448a82f4`](nodejs/node@72448a82f4)] - **http2**: avoid copying the options in respond() (Matteo Collina) [#​64265](nodejs/node#64265) - \[[`f6692da576`](nodejs/node@f6692da576)] - **http2**: avoid per-write closures in kWriteGeneric (Matteo Collina) [#​64265](nodejs/node#64265) - \[[`3ed37153f8`](nodejs/node@3ed37153f8)] - **http2**: reduce per-request allocations (Matteo Collina) [#​64265](nodejs/node#64265) - \[[`bce92debba`](nodejs/node@bce92debba)] - ***Revert*** "**http2**: avoid per-write closures in kWriteGeneric" (Antoine du Hamel) [#​64663](nodejs/node#64663) - \[[`b5d5dd74a1`](nodejs/node@b5d5dd74a1)] - ***Revert*** "**http2**: avoid copying the options in respond()" (Antoine du Hamel) [#​64663](nodejs/node#64663) - \[[`19b9c14d60`](nodejs/node@19b9c14d60)] - **lib**: fix AbortSignal.any() observed-composite leak (Paul Bouchon) [#​64481](nodejs/node#64481) - \[[`d3cada57c2`](nodejs/node@d3cada57c2)] - **lib**: fix typo in comment in \_http\_client.js (agape1225) [#​64729](nodejs/node#64729) - \[[`c1e4f7365e`](nodejs/node@c1e4f7365e)] - **(SEMVER-MINOR)** **lib**: add perfetto support (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`6c2157522d`](nodejs/node@6c2157522d)] - **loader**: enforce path normalization before lookup (Maël Nison) [#​63917](nodejs/node#63917) - \[[`31522c41a7`](nodejs/node@31522c41a7)] - **meta**: bump actions/stale from 10.3.0 to 11.0.0 (dependabot\[bot]) [#​64935](nodejs/node#64935) - \[[`88c8b8ef54`](nodejs/node@88c8b8ef54)] - **meta**: bump github/codeql-action/analyze from 4.36.2 to 4.37.3 (dependabot\[bot]) [#​64934](nodejs/node#64934) - \[[`9dcd759a84`](nodejs/node@9dcd759a84)] - **meta**: bump github/codeql-action/autobuild from 4.36.2 to 4.37.3 (dependabot\[bot]) [#​64933](nodejs/node#64933) - \[[`82ca02db3c`](nodejs/node@82ca02db3c)] - **meta**: bump actions/setup-python from 6.3.0 to 7.0.0 (dependabot\[bot]) [#​64932](nodejs/node#64932) - \[[`848e2287f2`](nodejs/node@848e2287f2)] - **meta**: bump github/codeql-action/init from 4.36.2 to 4.37.3 (dependabot\[bot]) [#​64931](nodejs/node#64931) - \[[`ae8ad3b17b`](nodejs/node@ae8ad3b17b)] - **meta**: bump Mozilla-Actions/sccache-action from 0.0.10 to 0.0.11 (dependabot\[bot]) [#​64930](nodejs/node#64930) - \[[`0b359cfa4c`](nodejs/node@0b359cfa4c)] - **meta**: bump cachix/install-nix-action from 31.10.6 to 31.11.0 (dependabot\[bot]) [#​64929](nodejs/node#64929) - \[[`3b4f980f4c`](nodejs/node@3b4f980f4c)] - **meta**: bump github/codeql-action/upload-sarif from 4.36.2 to 4.37.3 (dependabot\[bot]) [#​64927](nodejs/node#64927) - \[[`d7ee9e9ea7`](nodejs/node@d7ee9e9ea7)] - **meta**: bump step-security/harden-runner from 2.19.4 to 2.20.0 (dependabot\[bot]) [#​64926](nodejs/node#64926) - \[[`7e80bbaaa9`](nodejs/node@7e80bbaaa9)] - **meta**: bump ossf/scorecard-action from 2.4.3 to 2.4.4 (dependabot\[bot]) [#​64925](nodejs/node#64925) - \[[`915cabbfcf`](nodejs/node@915cabbfcf)] - **meta**: remove node\_crates .gitignore (René) [#​64779](nodejs/node#64779) - \[[`8e03c54347`](nodejs/node@8e03c54347)] - **meta**: add [@​nodejs/url](https://github.com/nodejs/url) as codeowner for node\_url\_pattern.\* (Efe Karasakal) [#​64737](nodejs/node#64737) - \[[`11c2f9c642`](nodejs/node@11c2f9c642)] - **(SEMVER-MINOR)** **module**: implement Symbol.dispose in ModuleHooks (Remco Haszing) [#​63928](nodejs/node#63928) - \[[`fffd8a76d0`](nodejs/node@fffd8a76d0)] - **net**: support TCP handle transfer on Windows (Matteo Collina) [#​64460](nodejs/node#64460) - \[[`fe9e0dbdc2`](nodejs/node@fe9e0dbdc2)] - **net**: support AF\_UNIX paths in net.BoundSocket (Guy Bedford) [#​64399](nodejs/node#64399) - \[[`eb61b7ee1e`](nodejs/node@eb61b7ee1e)] - **permission**: add unique warning codes (David Evans) [#​64414](nodejs/node#64414) - \[[`999a928822`](nodejs/node@999a928822)] - **permission**: support v8.setHeapSnapshotNearHeapLimit (Ilyas Shabi) [#​64808](nodejs/node#64808) - \[[`7de3d095b6`](nodejs/node@7de3d095b6)] - **quic**: fix stop sending behaviour & callback (Tim Perry) [#​64710](nodejs/node#64710) - \[[`6289398bb2`](nodejs/node@6289398bb2)] - **quic**: fix coverage comment typo (Jungwon Sohn) [#​64486](nodejs/node#64486) - \[[`01510dc759`](nodejs/node@01510dc759)] - **quic**: fix segfault after fragmented client hello (Tim Perry) [#​64720](nodejs/node#64720) - \[[`dcc348af97`](nodejs/node@dcc348af97)] - **quic**: serialize stream reset code as string (한만욱) [#​64577](nodejs/node#64577) - \[[`c25b8e3331`](nodejs/node@c25b8e3331)] - **readline**: reduce createInterface overhead (Matteo Collina) [#​64585](nodejs/node#64585) - \[[`14e802d1cd`](nodejs/node@14e802d1cd)] - **sqlite**: invalidate sessions when closing database (Trivikram Kamat) [#​64783](nodejs/node#64783) - \[[`279547b7da`](nodejs/node@279547b7da)] - **sqlite**: check database state before calling SQLite (Trivikram Kamat) [#​64812](nodejs/node#64812) - \[[`bb86521a42`](nodejs/node@bb86521a42)] - **sqlite**: fix crash when a session outlives its database (Mohamed Sayed) [#​63797](nodejs/node#63797) - \[[`870f4997e7`](nodejs/node@870f4997e7)] - **sqlite**: fix use-after-free in Exec() and ApplyChangeset() (Matteo Collina) [#​64535](nodejs/node#64535) - \[[`a8ec5a9df7`](nodejs/node@a8ec5a9df7)] - **src**: fix perfetto build on GetTraceFilePath (Chengzhong Wu) [#​64721](nodejs/node#64721) - \[[`6cd643acaa`](nodejs/node@6cd643acaa)] - **src**: implement MemoryRetainer protocol for ByteSource (Filip Skokan) [#​64660](nodejs/node#64660) - \[[`8725e56928`](nodejs/node@8725e56928)] - **src**: fix crash when writing odd-length hex string via Writev (RajeshKumar11) [#​63658](nodejs/node#63658) - \[[`e018f9a4a1`](nodejs/node@e018f9a4a1)] - **(SEMVER-MINOR)** **src**: add perfetto trace agent (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`0611d443ab`](nodejs/node@0611d443ab)] - **(SEMVER-MINOR)** **src**: rename legacy trace event headers (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`2897cc1d93`](nodejs/node@2897cc1d93)] - **(SEMVER-MINOR)** **src**: fix trace macro compatibility (Chengzhong Wu) [#​64565](nodejs/node#64565) - \[[`d4d7172e10`](nodejs/node@d4d7172e10)] - **src**: avoid using ToLocalChecked in crypto\_hash (James M Snell) [#​64668](nodejs/node#64668) - \[[`53b7d48b47`](nodejs/node@53b7d48b47)] - **src**: fix libuv assertion on windows (liuxingbaoyu) [#​61999](nodejs/node#61999) - \[[`69d10ed021`](nodejs/node@69d10ed021)] - **src,test**: disable trace events tests when perfetto is enabled (Chengzhong Wu) [#​64721](nodejs/node#64721) - \[[`1b0597b4ef`](nodejs/node@1b0597b4ef)] - **stream**: cut per-chunk allocations in pipeTo (Matteo Collina) [#​64890](nodejs/node#64890) - \[[`2632d606bb`](nodejs/node@2632d606bb)] - **stream**: preserve push signal abort reason (Trivikram Kamat) [#​64798](nodejs/node#64798) - \[[`d5358a75bc`](nodejs/node@d5358a75bc)] - **stream**: skip zero-byte broadcast writes (Trivikram Kamat) [#​64772](nodejs/node#64772) - \[[`796c896fb4`](nodejs/node@796c896fb4)] - **stream**: honor AbortSignal in Writer.end() (Trivikram Kamat) [#​64727](nodejs/node#64727) - \[[`ff12b8e22e`](nodejs/node@ff12b8e22e)] - **stream**: use validateString for consumer encoding (Jungwon Sohn) [#​64754](nodejs/node#64754) - \[[`cfad2efb06`](nodejs/node@cfad2efb06)] - **stream**: use the ring buffer for pending BYOB pull-into descriptors (Matteo Collina) [#​64818](nodejs/node#64818) - \[[`fe06bf56dc`](nodejs/node@fe06bf56dc)] - **stream**: fix uncatchable error closing half-open Duplex.toWeb() writable (Mohamed Sayed) [#​64161](nodejs/node#64161) - \[[`f2919dbb83`](nodejs/node@f2919dbb83)] - **test**: unflake debugger and REPL tests (Matteo Collina) [#​64718](nodejs/node#64718) - \[[`a1c29174e8`](nodejs/node@a1c29174e8)] - **test**: ensure assertions are reached on all tests (Antoine du Hamel) [#​64716](nodejs/node#64716) - \[[`b9e596f8e5`](nodejs/node@b9e596f8e5)] - **test**: reuse ffi.suffix instead of reimplementing it (Seongeun Lee) [#​64840](nodejs/node#64840) - \[[`c816918e14`](nodejs/node@c816918e14)] - **test**: remove test-repl-user-error-handler from flaky (avivkeller) [#​64631](nodejs/node#64631) - \[[`9d2f10ec54`](nodejs/node@9d2f10ec54)] - **test**: update WPT for url to [`4832db4`](nodejs/node@4832db4761) (Node.js GitHub Bot) [#​64829](nodejs/node#64829) - \[[`75b80d0b7b`](nodejs/node@75b80d0b7b)] - **test**: update WPT for url to [`b63305b`](nodejs/node@b63305b743) (Node.js GitHub Bot) [#​64790](nodejs/node#64790) - \[[`9a139b3c86`](nodejs/node@9a139b3c86)] - **test**: cover worker throwing primitive values (varshitha) [#​64365](nodejs/node#64365) - \[[`796acc8920`](nodejs/node@796acc8920)] - **test**: mark test-repl-user-error-handler as flaky (Aviv Keller) [#​64612](nodejs/node#64612) - \[[`a646319f61`](nodejs/node@a646319f61)] - **(SEMVER-MINOR)** **test\_runner**: add support for --test-coverage-include-all (avivkeller) [#​64830](nodejs/node#64830) - \[[`4368303e01`](nodejs/node@4368303e01)] - **test\_runner**: wait for filtered suite build (semimikoh) [#​64208](nodejs/node#64208) - \[[`70d11241a3`](nodejs/node@70d11241a3)] - **test\_runner**: convert to uint during deserialization (Aviv Keller) [#​64706](nodejs/node#64706) - \[[`cafe7bffcc`](nodejs/node@cafe7bffcc)] - **tls**: fix SNICallback certificate selection (Matteo Collina) [#​64700](nodejs/node#64700) - \[[`9ee05ec40f`](nodejs/node@9ee05ec40f)] - **tools**: bump the eslint group in /tools/eslint with 4 updates (dependabot\[bot]) [#​64928](nodejs/node#64928) - \[[`5f4b859932`](nodejs/node@5f4b859932)] - **tools**: bump brace-expansion from 5.0.7 to 5.0.9 in /tools/eslint (dependabot\[bot]) [#​64904](nodejs/node#64904) - \[[`b5ced907b3`](nodejs/node@b5ced907b3)] - **tools**: use 'readonly' for EventSource global (Honey Tyagi) [#​64787](nodejs/node#64787) - \[[`fd4460e34e`](nodejs/node@fd4460e34e)] - **typings**: add heap\_utils internalBinding types (Donghoon Kang) [#​64816](nodejs/node#64816) - \[[`3bc0ee0492`](nodejs/node@3bc0ee0492)] - **typings**: remove isDataView from types binding (Archkon) [#​64738](nodejs/node#64738) - \[[`236d7ca965`](nodejs/node@236d7ca965)] - **url**: create URLPattern result properties in WebIDL order (Archkon) [#​64733](nodejs/node#64733) - \[[`3def577ab4`](nodejs/node@3def577ab4)] - **v8**: report minor mark-sweep in GCProfiler (Archkon) [#​64688](nodejs/node#64688) - \[[`5293abff73`](nodejs/node@5293abff73)] - **vfs**: speed up recursive readdir test setup (Trivikram Kamat) [#​64813](nodejs/node#64813) - \[[`4345185496`](nodejs/node@4345185496)] - **vfs**: make lchown update symlink metadata (Trivikram Kamat) [#​64573](nodejs/node#64573) - \[[`b6ab546de5`](nodejs/node@b6ab546de5)] - **wasm**: register missing SetURL function (Archkon) [#​64679](nodejs/node#64679) - \[[`f322870bd1`](nodejs/node@f322870bd1)] - **zlib**: validate pledgedSrcSize as a safe integer (Archkon) [#​64604](nodejs/node#64604) - \[[`44042c20d4`](nodejs/node@44042c20d4)] - **zlib**: accept ArrayBuffer dictionary in Zstd (Ryuhei Shima) [#​64599](nodejs/node#64599) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
When a compat API response finishes and the request had no body, kMaybeDestroy() takes the graceful-close path and sends RST_STREAM(NO_ERROR) right away. If the connection flow-control window is exhausted at that point, the empty END_STREAM DATA frame is still queued, so the reset goes out first and the END_STREAM frame is dropped, truncating an otherwise complete response. Skip the graceful close when the request already ended with its HEADERS frame, since there is no request body to abort. Fixes: nodejs#66525 Refs: nodejs#64265 Refs: nodejs#64663 Signed-off-by: Barath <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.