Skip to content

Commit f237c9d

Browse files
committed
emit TopologyDescriptionChangedEvent just before close
1 parent e292a79 commit f237c9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sdam/topology.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
509509
this.removeListener(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology);
510510

511511
stateTransition(this, STATE_CLOSED);
512+
this.s.description = new TopologyDescription(TopologyType.Unknown, new Map());
513+
514+
// broadcast that topology is in closed state
515+
this.emitAndLog(
516+
Topology.TOPOLOGY_DESCRIPTION_CHANGED,
517+
new TopologyDescriptionChangedEvent(this.s.id, previousDescription, this.s.description)
518+
);
512519

513520
// emit an event for close
514521
this.emitAndLog(Topology.TOPOLOGY_CLOSED, new TopologyClosedEvent(this.s.id));

0 commit comments

Comments
 (0)