Skip to content

Commit

Permalink
fix(sdam): topology no longer causes close event
Browse files Browse the repository at this point in the history
The topology was emitting both a "topologyClosed" and "close"
event which are bubbled up to the MongoClient. This was causing
two "close" events to be emitted from the MongoClient when the
client is closed.

NODE-3219
  • Loading branch information
durran committed Apr 27, 2021
1 parent 2b18411 commit bb33cb9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/core/sdam/topology.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ class Topology extends EventEmitter {
this.emit('topologyClosed', new events.TopologyClosedEvent(this.s.id));

stateTransition(this, STATE_CLOSED);
this.emit('close');

if (typeof callback === 'function') {
callback(err);
Expand Down

0 comments on commit bb33cb9

Please sign in to comment.