Skip to content

Commit 162b282

Browse files
mcollinaaduh95
authored andcommitted
deps: update undici to 6.21.2
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #57442 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent ee1c78a commit 162b282

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

deps/undici/src/lib/dispatcher/pool.js

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ class Pool extends PoolBase {
7373
? { ...options.interceptors }
7474
: undefined
7575
this[kFactory] = factory
76+
77+
this.on('connectionError', (origin, targets, error) => {
78+
// If a connection error occurs, we remove the client from the pool,
79+
// and emit a connectionError event. They will not be re-used.
80+
// Fixes https://github.com/nodejs/undici/issues/3895
81+
for (const target of targets) {
82+
// Do not use kRemoveClient here, as it will close the client,
83+
// but the client cannot be closed in this state.
84+
const idx = this[kClients].indexOf(target)
85+
if (idx !== -1) {
86+
this[kClients].splice(idx, 1)
87+
}
88+
}
89+
})
7690
}
7791

7892
[kGetDispatcher] () {

deps/undici/src/lib/llhttp/wasm_build_env.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
> undici@6.21.1 prebuild:wasm
2+
> undici@6.21.2 prebuild:wasm
33
> node build/wasm.js --prebuild
44

5-
> 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
5+
> 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
66

77

88

9-
> undici@6.21.1 build:wasm
9+
> undici@6.21.2 build:wasm
1010
> node build/wasm.js --docker
1111

12-
> 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
12+
> 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
1313

1414

1515
alpine-baselayout-3.4.3-r2

deps/undici/src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "undici",
3-
"version": "6.21.1",
3+
"version": "6.21.2",
44
"description": "An HTTP/1.1 client, written from scratch for Node.js",
55
"homepage": "https://undici.nodejs.org",
66
"bugs": {

deps/undici/src/types/interceptors.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ declare namespace Interceptors {
2828
export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
2929
export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
3030
export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
31+
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
3132
}

deps/undici/undici.js

+8
Original file line numberDiff line numberDiff line change
@@ -8123,6 +8123,14 @@ var require_pool = __commonJS({
81238123
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
81248124
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
81258125
this[kFactory] = factory;
8126+
this.on("connectionError", (origin2, targets, error) => {
8127+
for (const target of targets) {
8128+
const idx = this[kClients].indexOf(target);
8129+
if (idx !== -1) {
8130+
this[kClients].splice(idx, 1);
8131+
}
8132+
}
8133+
});
81268134
}
81278135
[kGetDispatcher]() {
81288136
for (const client of this[kClients]) {

src/undici_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// Refer to tools/dep_updaters/update-undici.sh
33
#ifndef SRC_UNDICI_VERSION_H_
44
#define SRC_UNDICI_VERSION_H_
5-
#define UNDICI_VERSION "6.21.1"
5+
#define UNDICI_VERSION "6.21.2"
66
#endif // SRC_UNDICI_VERSION_H_

0 commit comments

Comments
 (0)