Skip to content

Commit b8805dc

Browse files
committed
fix: ignore connection errors during pool destruction
There are some issues with older versions of node where errors can be emitted after `destroy` is called (e.g. EUNREACH, ECONNRESET). We want to ignore these during pool close.
1 parent 8a456db commit b8805dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/core/connection/pool.js

+3
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,9 @@ function destroy(self, connections, options, callback) {
641641
conn.removeAllListeners(eventName);
642642
}
643643

644+
// ignore any errors during destruction
645+
conn.on('error', () => {});
646+
644647
conn.destroy(options, cb);
645648
},
646649
err => {

0 commit comments

Comments
 (0)