Skip to content

Commit

Permalink
fix: ignore connection errors during pool destruction
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mbroadst committed Dec 30, 2019
1 parent 8a456db commit b8805dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/connection/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,9 @@ function destroy(self, connections, options, callback) {
conn.removeAllListeners(eventName);
}

// ignore any errors during destruction
conn.on('error', () => {});

conn.destroy(options, cb);
},
err => {
Expand Down

0 comments on commit b8805dc

Please sign in to comment.