From 342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 16 Dec 2025 16:51:48 +0100 Subject: bump dependencies --- node_modules/undici/lib/pool.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'node_modules/undici/lib/pool.js') diff --git a/node_modules/undici/lib/pool.js b/node_modules/undici/lib/pool.js index e3cd339..86b29d4 100644 --- a/node_modules/undici/lib/pool.js +++ b/node_modules/undici/lib/pool.js @@ -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] () { -- cgit v1.3