deps: update undici to 6.21.2

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/57442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Matteo Collina 2025-03-13 13:13:30 +01:00 committed by RafaelGSS
parent 757ebb2a2d
commit f8b969e800
No known key found for this signature in database
GPG key ID: 8BEAB4DFCF555EF4
6 changed files with 29 additions and 6 deletions

View file

@ -73,6 +73,20 @@ class Pool extends PoolBase {
? { ...options.interceptors }
: undefined
this[kFactory] = factory
this.on('connectionError', (origin, targets, error) => {
// If a connection error occurs, we remove the client from the pool,
// and emit a connectionError event. They will not be re-used.
// Fixes https://github.com/nodejs/undici/issues/3895
for (const target of targets) {
// Do not use kRemoveClient here, as it will close the client,
// but the client cannot be closed in this state.
const idx = this[kClients].indexOf(target)
if (idx !== -1) {
this[kClients].splice(idx, 1)
}
}
})
}
[kGetDispatcher] () {

View file

@ -1,15 +1,15 @@
> undici@6.21.1 prebuild:wasm
> undici@6.21.2 prebuild:wasm
> node build/wasm.js --prebuild
> docker build --platform=linux/aarch64 -t llhttp_wasm_builder -f /Users/matteo/repos/node-private/deps/undici/src/build/Dockerfile /Users/matteo/repos/node-private/deps/undici/src
> docker build --platform=linux/aarch64 -t llhttp_wasm_builder -f /Users/matteo/repos/node/deps/undici/src/build/Dockerfile /Users/matteo/repos/node/deps/undici/src
> undici@6.21.1 build:wasm
> undici@6.21.2 build:wasm
> node build/wasm.js --docker
> docker run --rm -t --platform=linux/aarch64 --mount type=bind,source=/Users/matteo/repos/node-private/deps/undici/src/lib/llhttp,target=/home/node/undici/lib/llhttp llhttp_wasm_builder node build/wasm.js
> docker run --rm -t --platform=linux/aarch64 --mount type=bind,source=/Users/matteo/repos/node/deps/undici/src/lib/llhttp,target=/home/node/undici/lib/llhttp llhttp_wasm_builder node build/wasm.js
alpine-baselayout-3.4.3-r2

View file

@ -1,6 +1,6 @@
{
"name": "undici",
"version": "6.21.1",
"version": "6.21.2",
"description": "An HTTP/1.1 client, written from scratch for Node.js",
"homepage": "https://undici.nodejs.org",
"bugs": {

View file

@ -28,4 +28,5 @@ declare namespace Interceptors {
export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
}

View file

@ -8123,6 +8123,14 @@ var require_pool = __commonJS({
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
this[kFactory] = factory;
this.on("connectionError", (origin2, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target);
if (idx !== -1) {
this[kClients].splice(idx, 1);
}
}
});
}
[kGetDispatcher]() {
for (const client of this[kClients]) {

View file

@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-undici.sh
#ifndef SRC_UNDICI_VERSION_H_
#define SRC_UNDICI_VERSION_H_
#define UNDICI_VERSION "6.21.1"
#define UNDICI_VERSION "6.21.2"
#endif // SRC_UNDICI_VERSION_H_