From edb1335f9dd85577ea1307672484bc44368e3005 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Tue, 5 Nov 2019 17:05:29 -0500 Subject: [PATCH] fix(topology): set max listeners to infinity for db event relay We relay topology events on the `Db` class for legacy compat, so we need to remove limitations on max listeners in case users are operating across many instances. NODE-2123 --- lib/core/sdam/topology.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/sdam/topology.js b/lib/core/sdam/topology.js index ee1211ba47..28cadef0a4 100644 --- a/lib/core/sdam/topology.js +++ b/lib/core/sdam/topology.js @@ -211,6 +211,9 @@ class Topology extends EventEmitter { this.on('topologyDescriptionChanged', this.s.detectTopologyDescriptionChange); } + + // NOTE: remove this when NODE-1709 is resolved + this.setMaxListeners(Infinity); } /**