diff options
| author | Egor Tensin <egor@tensin.name> | 2025-12-16 16:51:48 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2025-12-16 16:51:54 +0100 |
| commit | 342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9 (patch) | |
| tree | 1af9b90985a2685c70e8e756eabc62a21ca362bb /node_modules/undici/lib/pool.js | |
| parent | bump dependencies (diff) | |
| download | cleanup-path-342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9.tar.gz cleanup-path-342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9.zip | |
bump dependencies
Diffstat (limited to '')
| -rw-r--r-- | node_modules/undici/lib/pool.js | 14 |
1 files changed, 14 insertions, 0 deletions
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] () { |
