Skip to content

Commit

Permalink
fix(sdam): topology no longer causes close event (#2792)
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 authored Apr 29, 2021
1 parent 440de41 commit 6cd982f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/sdam/topology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ export class Topology extends EventEmitter {
this.emit(Topology.TOPOLOGY_CLOSED, new TopologyClosedEvent(this.s.id));

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

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

0 comments on commit 6cd982f

Please sign in to comment.